| 453 | } |
| 454 | |
| 455 | size_t StringUtil::countUTF8CodePoints(const std::string& str) { |
| 456 | size_t count = 0; |
| 457 | const char* cur = str.data(); |
| 458 | const char* end = cur + str.length(); |
| 459 | while (UTF8::nextCodepoint(&cur, end) != 0) { |
| 460 | ++count; |
| 461 | } |
| 462 | |
| 463 | return count; |
| 464 | } |
| 465 | |
| 466 | |
| 467 | String StringUtil::stripShell(const std::string& str) { |