| 75 | } |
| 76 | |
| 77 | std::vector<std::string> splitString(const std::string& str, const std::string& delim) |
| 78 | { |
| 79 | std::string s; |
| 80 | std::vector<std::string> vec; |
| 81 | for (char c : str) |
| 82 | { |
| 83 | if (delim.find(c) != std::string::npos) |
| 84 | { |
| 85 | if (s.length()) |
| 86 | { |
| 87 | vec.push_back(s); |
| 88 | s.clear(); |
| 89 | } |
| 90 | } |
| 91 | else |
| 92 | { |
| 93 | s += c; |
| 94 | } |
| 95 | } |
| 96 | if (s.length()) |
| 97 | { |
| 98 | vec.push_back(s); |
| 99 | } |
| 100 | return vec; |
| 101 | } |
| 102 | |
| 103 | std::string joinStrings(const std::vector<std::string>& strings, const std::string& separator) |
| 104 | { |