| 181 | } |
| 182 | |
| 183 | void StringUtilities::Split(const std::string& input, |
| 184 | const std::string& delimiter, |
| 185 | std::vector<std::string>* tokens) { |
| 186 | std::string input_copy = input; |
| 187 | while (input_copy.size() > 0) { |
| 188 | size_t delimiter_pos = input_copy.find(delimiter); |
| 189 | std::string token = input_copy.substr(0, delimiter_pos); |
| 190 | if (delimiter_pos == std::string::npos) { |
| 191 | input_copy = ""; |
| 192 | } else { |
| 193 | input_copy = input_copy.substr(delimiter_pos + delimiter.size()); |
| 194 | } |
| 195 | tokens->push_back(token); |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | void StringUtilities::Split(const std::wstring& input, |
| 200 | const std::wstring& delimiter, |