| 509 | } |
| 510 | |
| 511 | const utf8* trimStart(const utf8* str) |
| 512 | { |
| 513 | codepoint_t codepoint; |
| 514 | const utf8* ch = str; |
| 515 | const utf8* nextCh; |
| 516 | while ((codepoint = getNextCodepoint(ch, &nextCh)) != '\0') |
| 517 | { |
| 518 | if (codepoint <= WCHAR_MAX && !isWhiteSpace(codepoint)) |
| 519 | { |
| 520 | return ch; |
| 521 | } |
| 522 | ch = nextCh; |
| 523 | } |
| 524 | // String is all whitespace |
| 525 | return ch; |
| 526 | } |
| 527 | |
| 528 | std::string trimStart(const std::string& s) |
| 529 | { |