MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / trimStart

Function trimStart

src/openrct2/core/String.cpp:511–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 2

TEST_PFunction · 0.85
NormaliseNameFunction · 0.85

Calls 2

getNextCodepointFunction · 0.85
isWhiteSpaceFunction · 0.85

Tested by 1

TEST_PFunction · 0.68