| 268 | } |
| 269 | |
| 270 | std::vector<std::string> splitString(const std::string& string, char delimiter) { |
| 271 | std::vector<std::string> results; |
| 272 | if (!string.empty()) { // Only do work if there is work to do |
| 273 | std::stringstream stream(string); |
| 274 | std::string substring; |
| 275 | while (std::getline(stream, substring, delimiter)) { // Loop and fill the results vector |
| 276 | results.push_back(substring); |
| 277 | } |
| 278 | if (*(string.end() - 1) == delimiter) { // Add an empty string if the last char is the delimiter |
| 279 | results.push_back(std::string()); |
| 280 | } |
| 281 | } |
| 282 | return results; |
| 283 | } |
| 284 | |
| 285 | std::vector<std::string> splitEMSLineToTokens(const std::string& line, const std::string& delimiters) { |
| 286 | |