Skip to main content

strings.CutPrefix

Remove prefix if present, returns [result, found]

strings.CutPrefix(s: string, prefix: string) -> (string, bool)

Arguments

NameType
sstring
prefixstring

Example

{{ strings.CutPrefix("hello", "hel") }}

Returns ["lo", true].