while (end != std::string::npos) {
lst.push_back(str.substr(start, end - start));
start = end + separator.length();
end = str.find(separator, start);
}
lst.push_back(str.substr(start));
return lst;
}
int main() {
std::string text = "This is a sample text";
std::vector words = split(text, " ");