Skip to content

Instantly share code, notes, and snippets.

@Caesar-Victory
Created April 12, 2023 14:26
Show Gist options
  • Select an option

  • Save Caesar-Victory/573490e2e534fbff8b2fb776c3429b62 to your computer and use it in GitHub Desktop.

Select an option

Save Caesar-Victory/573490e2e534fbff8b2fb776c3429b62 to your computer and use it in GitHub Desktop.
#C++
auto getWords = [&](string &sentence) -> vector<string> {
vector<string> ans;
istringstream iss(sentence);
string word = "";
while (iss >> word) {
ans.push_back(word);
}
return ans;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment