MCPcopy Create free account
hub / github.com/alibaba/graph-learn / ConsumePrefix

Function ConsumePrefix

graphlearn/src/common/string/string_tool.cc:122–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122bool ConsumePrefix(LiteString* s, LiteString expected) {
123 if (s->starts_with(expected)) {
124 s->remove_prefix(expected.size());
125 return true;
126 }
127 return false;
128}
129
130bool ConsumeSuffix(LiteString* s, LiteString expected) {
131 if (s->ends_with(expected)) {

Callers

nothing calls this directly

Calls 3

starts_withMethod · 0.80
remove_prefixMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected