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

Function Strings

ext/strings.go:319–327  ·  view source on GitHub ↗

Strings returns a cel.EnvOption to configure extended functions for string manipulation. As a general note, all indices are zero-based. # CharAt Introduced at version: 0 (cost support in version 5) Returns the character at the given position. If the position is negative, or greater than the lengt

(options ...StringsOption)

Source from the content-addressed store, hash-verified

317//
318// <string>.format(<list>) -> <string>
319func Strings(options ...StringsOption) cel.EnvOption {
320 s := &stringLib{
321 version: math.MaxUint32,
322 }
323 for _, o := range options {
324 s = o(s)
325 }
326 return cel.Lib(s)
327}
328
329type stringLib struct {
330 locale string

Callers 15

bench.goFile · 0.92
initFunction · 0.92
evaluator.goFile · 0.92
TestStringFormatFunction · 0.85
TestBadLocaleFunction · 0.85
TestLiteralOutputFunction · 0.85

Calls 1

LibFunction · 0.92

Tested by 15

initFunction · 0.74
TestStringFormatFunction · 0.68
TestBadLocaleFunction · 0.68
TestLiteralOutputFunction · 0.68
TestStringFormatV2Function · 0.68
TestBindingsFunction · 0.68