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

Function IndexOf3

extensions/strings.cc:118–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118Value IndexOf3(const StringValue& haystack, const StringValue& needle,
119 int64_t pos) {
120 if (pos > haystack.Size()) {
121 return ErrorValue{
122 absl::InvalidArgumentError(absl::StrCat("index out of range: ", pos))};
123 }
124 return IntValue(haystack.IndexOf(needle, pos).value_or(-1));
125}
126
127int64_t LastIndexOf2(const StringValue& haystack, const StringValue& needle) {
128 return haystack.LastIndexOf(needle).value_or(-1);

Callers

nothing calls this directly

Calls 3

IntValueClass · 0.50
SizeMethod · 0.45
IndexOfMethod · 0.45

Tested by

no test coverage detected