MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / trimBeg

Method trimBeg

source/core/StarString.cpp:453–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451}
452
453String String::trimBeg(String const& pattern) const {
454 size_t beg;
455 for (beg = 0; beg < size(); ++beg) {
456 Char bc = (*this)[beg];
457 if (!pattern.hasCharOrWhitespace(bc))
458 break;
459 }
460 return substr(beg);
461}
462
463String String::trim(String const& pattern) const {
464 return trimEnd(pattern).trimBeg(pattern);

Callers 2

unixFileJoinFunction · 0.80
trimMethod · 0.80

Calls 2

sizeFunction · 0.85
hasCharOrWhitespaceMethod · 0.45

Tested by

no test coverage detected