MCPcopy Create free account
hub / github.com/chen3feng/toft / StringRemovePrefix

Function StringRemovePrefix

base/string/algorithm.h:48–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46bool StringStartsWithIgnoreCase(const StringPiece& str, const StringPiece& prefix);
47
48inline std::string StringRemovePrefix(const StringPiece& str, const StringPiece& prefix)
49{
50 if (StringStartsWith(str, prefix))
51 {
52 return str.substr(prefix.size()).as_string();
53 }
54 return str.as_string();
55}
56
57inline bool StringRemovePrefix(std::string* str, const StringPiece& prefix)
58{

Callers 1

TESTFunction · 0.85

Calls 5

StringStartsWithFunction · 0.85
as_stringMethod · 0.80
substrMethod · 0.80
eraseMethod · 0.80
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.68