Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<string> Menu::splitString(string cmd, char delimiter)
- {
- vector<string> splittedString;
- string singlePart = "";
- for (int i = 0; i < cmd.length(); i++) {
- if (cmd[i] != delimiter) {
- singlePart += cmd[i];
- }
- else {
- if (singlePart != "") {
- splittedString.push_back(singlePart);
- singlePart = "";
- }
- }
- }
- if (singlePart != "")
- splittedString.push_back(singlePart);
- return splittedString;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement