| 26 | namespace skr |
| 27 | { |
| 28 | inline void split(const skr::stl_u8string_view& s, skr::stl_vector<skr::stl_u8string_view>& tokens, const skr::stl_u8string_view& delimiters = u8" ") |
| 29 | { |
| 30 | skr::stl_string::size_type lastPos = s.find_first_not_of(delimiters, 0); |
| 31 | skr::stl_string::size_type pos = s.find_first_of(delimiters, lastPos); |
| 32 | while (skr::stl_string::npos != pos || skr::stl_string::npos != lastPos) |
| 33 | { |
| 34 | auto substr = s.substr(lastPos, pos - lastPos); |
| 35 | tokens.push_back(substr); // use emplace_back after C++11 |
| 36 | lastPos = s.find_first_not_of(delimiters, pos); |
| 37 | pos = s.find_first_of(delimiters, lastPos); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | inline bool ends_with(skr::stl_u8string_view const& value, skr::stl_u8string_view const& ending) |
| 42 | { |
no test coverage detected