MCPcopy Create free account
hub / github.com/araddon/qlbridge / hasPrefixEval

Function hasPrefixEval

expr/builtins/string.go:345–351  ·  view source on GitHub ↗
(ctx expr.EvalContext, vals []value.Value)

Source from the content-addressed store, hash-verified

343 return hasPrefixEval, nil
344}
345func hasPrefixEval(ctx expr.EvalContext, vals []value.Value) (value.Value, bool) {
346 prefixStr := vals[1].ToString()
347 if len(prefixStr) == 0 {
348 return value.BoolValueFalse, false
349 }
350 return value.NewBoolValue(strings.HasPrefix(vals[0].ToString(), prefixStr)), true
351}
352
353// HasSuffix string evaluation to see if string ends with
354//

Callers

nothing calls this directly

Calls 2

NewBoolValueFunction · 0.92
ToStringMethod · 0.65

Tested by

no test coverage detected