MCPcopy Create free account
hub / github.com/XiaoMi/mace / GetStrAfterPattern

Function GetStrAfterPattern

mace/utils/string_util.cc:157–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157std::string GetStrAfterPattern(const std::string &str,
158 const std::string &pattern) {
159 std::string whitespaces(" \t\f\v\n\r");
160 size_t pat_start;
161 size_t idx = str.find(pattern);
162 if (idx == std::string::npos) {
163 return "";
164 }
165 pat_start = str.find_first_not_of(whitespaces, idx+pattern.size());
166 if (pat_start == std::string::npos) {
167 return "";
168 }
169 idx = str.find_first_of(whitespaces, pat_start);
170 if (idx == std::string::npos) {
171 return str.substr(pat_start);
172 }
173 return str.substr(pat_start, idx-pat_start);
174}
175} // namespace mace

Callers 2

ParseQcomDateFromVersionFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected