Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<string>split(string s, char sp){
- string p = "";
- vector<string> splited;
- for (int i = 0; i < int(s.size()); ++i){
- if (s[i] == sp){
- splited.push_back(p);
- p = "";
- }else{
- p += s[i];
- }
- }
- splited.push_back(p);
- return splited;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement