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

Function charAt

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

Source from the content-addressed store, hash-verified

621}
622
623func charAt(str string, ind int64) (string, error) {
624 i := int(ind)
625 runes := []rune(str)
626 if i < 0 || i > len(runes) {
627 return "", fmt.Errorf("index out of range: %d", ind)
628 }
629 if i == len(runes) {
630 return "", nil
631 }
632 return string(runes[i]), nil
633}
634
635func indexOf(str, substr string) (int64, error) {
636 return indexOfOffset(str, substr, int64(0))

Callers 1

CompileOptionsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected