MCPcopy Create free account
hub / github.com/cel-expr/cel-go / lastIndexOf

Function lastIndexOf

ext/strings.go:672–682  ·  view source on GitHub ↗
(str, substr string)

Source from the content-addressed store, hash-verified

670}
671
672func lastIndexOf(str, substr string) (int64, error) {
673 runes := []rune(str)
674 if substr == "" {
675 return int64(len(runes)), nil
676 }
677
678 if len(str) < len(substr) {
679 return -1, nil
680 }
681 return lastIndexOfOffset(str, substr, int64(len(runes)-1))
682}
683
684func lastIndexOfOffset(str, substr string, offset int64) (int64, error) {
685 off := int(offset)

Callers 1

CompileOptionsMethod · 0.85

Calls 1

lastIndexOfOffsetFunction · 0.85

Tested by

no test coverage detected