| 81 | } |
| 82 | |
| 83 | std::vector<UString> split(const UStringView str, const UStringView delims) |
| 84 | { |
| 85 | // FIXME: Probably won't work if any of 'delims' is outside the ASCII range |
| 86 | std::vector<UString> strings; |
| 87 | size_t pos = 0; |
| 88 | size_t prev = pos; |
| 89 | while ((pos = str.find_first_of(delims, prev)) != std::string::npos) |
| 90 | { |
| 91 | if (pos > prev) |
| 92 | strings.push_back(UString(str.substr(prev, pos - prev))); |
| 93 | prev = pos + 1; |
| 94 | } |
| 95 | strings.push_back(UString(str.substr(prev, pos))); |
| 96 | return strings; |
| 97 | } |
| 98 | |
| 99 | UString insert_codepoints(const UStringView str, size_t offset, const UStringView insert) |
| 100 | { |
no outgoing calls
no test coverage detected