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

Function charAt

ext/strings.go:650–660  ·  view source on GitHub ↗
(str string, ind int64)

Source from the content-addressed store, hash-verified

648}
649
650func charAt(str string, ind int64) (string, error) {
651 i := int(ind)
652 runes := []rune(str)
653 if i < 0 || i > len(runes) {
654 return "", fmt.Errorf("index out of range: %d", ind)
655 }
656 if i == len(runes) {
657 return "", nil
658 }
659 return string(runes[i]), nil
660}
661
662func indexOf(str, substr string) (int64, error) {
663 return indexOfOffset(str, substr, int64(0))

Callers 1

CompileOptionsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected