MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / CountSubstrings

Function CountSubstrings

testing/testrunner/runner_lib_test.cc:80–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80int CountSubstrings(absl::string_view text, absl::string_view substr) {
81 int count = 0;
82 size_t pos = 0;
83 while ((pos = text.find(substr, pos)) != absl::string_view::npos) {
84 ++count;
85 ++pos;
86 }
87 return count;
88}
89
90absl::StatusOr<std::unique_ptr<cel::Compiler>> CreateBasicCompiler() {
91 CEL_ASSIGN_OR_RETURN(

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected