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

Function StartWith

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

Source from the content-addressed store, hash-verified

136}
137
138bool StartWith(const std::string& s, const std::string& pattern) {
139 if (s.size() < pattern.size()) {
140 return false;
141 }
142 for (size_t i = 0; i < pattern.size(); ++i) {
143 if (s[i] != pattern[i]) {
144 return false;
145 }
146 }
147 return true;
148}
149
150bool EndWith(const std::string& s, const std::string& pattern) {
151 if (s.size() < pattern.size()) {

Callers 2

IsDistributeSharedMethod · 0.85
SingleThreadModeMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected