| 54 | #endif |
| 55 | |
| 56 | vector<string> split_string(const string& str, const string& delimiters) |
| 57 | { |
| 58 | vector<string> res; |
| 59 | |
| 60 | string split_str = str; |
| 61 | size_t pos_delim = split_str.find(delimiters); |
| 62 | |
| 63 | while ( pos_delim != string::npos) |
| 64 | { |
| 65 | if (pos_delim == 0) |
| 66 | { |
| 67 | res.push_back(""); |
| 68 | split_str.erase(0, 1); |
| 69 | } |
| 70 | else |
| 71 | { |
| 72 | res.push_back(split_str.substr(0, pos_delim)); |
| 73 | split_str.erase(0, pos_delim + 1); |
| 74 | } |
| 75 | |
| 76 | pos_delim = split_str.find(delimiters); |
| 77 | } |
| 78 | |
| 79 | res.push_back(split_str); |
| 80 | |
| 81 | return res; |
| 82 | } |
| 83 | |
| 84 | string del_space(string name) |
| 85 | { |
no test coverage detected