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

Function charAt

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

Source from the content-addressed store, hash-verified

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

Callers 1

CompileOptionsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected