Documentation
¶
Index ¶
- func Concat(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func Contains(_ context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)
- func EndsWith(_ context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)
- func FindFirst(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func FindLast(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func Fmt(_ context.Context, args ...runtime.Value) (runtime.Value, error)
- func Join(ctx context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)
- func LTrim(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func Left(_ context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)
- func Like(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func Lower(_ context.Context, arg runtime.Value) (runtime.Value, error)
- func RTrim(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func RegexFind(_ context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)
- func RegexFindAll(ctx context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)
- func RegexReplace(_ context.Context, arg1, arg2, arg3 runtime.Value) (runtime.Value, error)
- func RegexSplit(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func RegexTest(_ context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)
- func RegisterLib(ns runtime.Namespace)
- func Repeat(_ context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)
- func Replace(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func Right(_ context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)
- func Split(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func StartsWith(_ context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)
- func Substring(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func Trim(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func Upper(_ context.Context, arg runtime.Value) (runtime.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Concat ¶
concat concatenates values using their string representations. With one List argument, concatenates its elements. None contributes no text; nested lists are not flattened. @param src {Any, repeated} Values to concatenate, or a single List of values. @return {String} A string value.
func Contains ¶
contains reports whether text contains search. @param text {String} The source string. @param search {String} The literal string to match. @return {Boolean} Whether the literal string matches.
func EndsWith ¶
ends_with reports whether text ends with suffix. @param text {String} The source string. @param suffix {String} The literal string to match. @return {Boolean} Whether the literal string matches.
func FindFirst ¶
find_first returns the position of the first occurrence of the string search inside the string text. Positions start at 0. @param str {String} The source string. @param search {String} The string to seek. @param start {Int} Limit the search to a subset of the text, beginning at start. @param end {Int} Limit the search to a subset of the text, ending before end. @return {Int} The character position of the match. If search is not contained in text, -1 is returned. If search is empty, start is returned.
func FindLast ¶
find_last returns the position of the last occurrence of the string search inside the string text. Positions start at 0. @param src {String} The source string. @param search {String} The string to seek. @param start {Int} Limit the search to a subset of the text, beginning at start. @param end {Int} Limit the search to a subset of the text, ending before end. @return {Int} The character position of the match. If search is not contained in text, -1 is returned. If search is empty, end is returned.
func Fmt ¶
fmt substitutes values using either automatic {} placeholders or zero-based {n} indexes. Modes cannot be mixed. Repeated indexes are allowed. Escape literal braces with {{ and }}. Every supplied value must be referenced. @param template {String} The format string. Indexes contain decimal digits only. @param values {Any, repeated} Values substituted using their string representations. @return {String} The formatted string. Malformed braces, missing values, and unused values are errors.
func Join ¶
join concatenates a list of strings with one separator between adjacent elements, preserving empty strings. @param values {String[]} The strings to join in iteration order. Nested lists and non-strings are invalid. @param separator {String} The literal separator. @return {String} The joined string, or an empty string for an empty list.
func LTrim ¶
ltrim returns the string value with whitespace stripped from the start only. @param str {String} The string. @param chars {String} Literal rune cutset. An empty cutset leaves the string unchanged. Omit to trim Unicode whitespace. @return {String} The string without chars at the left-hand side.
func Left ¶
left returns the leftmost characters of the string value by index. @param str {String} The source string. @param length {Int} Non-negative rune count, clamped to the string length. @return {String} The leftmost characters of the string value by index.
func Like ¶
like matches the whole string using glob syntax: * matches any sequence, ? matches one rune, and character classes and alternatives are supported. Percent and underscore are literal. @param str {String} The string to search in. @param search {String} A search pattern that can contain the wildcard characters. @param caseInsensitive {Boolean} If set to true, the matching will be case-insensitive. The default is false. @return {Boolean} Whether the whole string matches the pattern.
func Lower ¶
lower converts strings to their lower-case counterparts. All other characters are returned unchanged. @param str {String} The source string. @return {String} The string in lower case.
func RTrim ¶
rtrim returns the string value with whitespace stripped from the end only. @param str {String} The string. @param chars {String} Literal rune cutset. An empty cutset leaves the string unchanged. Omit to trim Unicode whitespace. @return {String} The string without chars at the right-hand side.
func RegexFind ¶
regex_find finds the first match of a Go regular expression. Use inline flags such as (?i). Captures exclude the full match, preserve declaration order, and use empty strings for unmatched groups. Duplicate named capture groups are invalid, even when no match exists. @param text {String} The source string. @param pattern {String} The Go regular expression. @return {Object | None} An object with match (String), groups (String[]), and named (Object), or None when no match exists.
func RegexFindAll ¶
regex_find_all finds non-overlapping matches in source order using Go regular expression semantics. Empty matches adjacent to a preceding match are ignored. Use inline flags such as (?i). Capture fields follow regex_find. Duplicate named capture groups are invalid, even when no match exists. @param text {String} The source string. @param pattern {String} The Go regular expression. @return {Object[]} Objects with match (String), groups (String[]), and named (Object). No matches returns an empty array.
func RegexReplace ¶
regex_replace replaces all non-overlapping matches of a Go regular expression. Use inline flags such as (?i). @param text {String} The source string. @param pattern {String} The Go regular expression. @param replacement {String} Go replacement template: $1 and ${name} expand captures, and $$ inserts a literal dollar sign. @return {String} The string with matches replaced.
func RegexSplit ¶
regex_split splits text at matches of a Go regular expression. Use inline flags such as (?i). Empty matches follow Go regexp.Split semantics. @param text {String} The source string. @param pattern {String} The separator expression. @param limit {Int} Non-negative maximum result count. Zero returns an empty array; positive limits preserve the unsplit remainder. Omitted means unlimited. @return {String[]} The pieces between matches.
func RegexTest ¶
regex_test reports whether a Go regular expression matches any part of text. Use inline flags such as (?i). @param text {String} The source string. @param pattern {String} The Go regular expression. @return {Boolean} Whether a match exists.
func RegisterLib ¶
RegisterLib registers global string operations.
func Repeat ¶
repeat concatenates count copies of text. @param text {String} The string to repeat. @param count {Int} Non-negative repetition count that fits in an Int on the host. The result must not exceed 64 MiB (67108864 UTF-8 bytes), including when count is one. @return {String} The repeated string. Zero count or empty text returns an empty string for a valid count. Oversized results return an argument error that ON ERROR can catch.
func Replace ¶
replace replaces literal, non-overlapping occurrences. An empty search matches before each rune and at the end; replacement text is literal. @param str {String} The string to modify @param search {String} The string representing a search pattern @param replace {String} The string representing a replace value @param limit {Int} Non-negative maximum replacements. Zero leaves text unchanged; omitted means unlimited. @return {String} Returns a string with replace substring.
func Right ¶
right returns the rightmost characters of the string value. @param str {String} The source string. @param length {Int} Non-negative rune count, clamped to the string length. @return {String} The rightmost characters of the string value.
func Split ¶
split splits the given string value into a list of strings, using the separator. @param str {String} The string to split. @param separator {String} The separator. @param limit {Int} Non-negative maximum result count. Zero returns an empty array; positive limits preserve the unsplit remainder. If no limit is given, the number of splits returned is not bounded. @return {String[]} arrayList of strings.
func StartsWith ¶
starts_with reports whether text begins with prefix. @param text {String} The source string. @param prefix {String} The literal string to match. @return {Boolean} Whether the literal string matches.
func Substring ¶
substring returns a substring of value. @param str {String} The source string. @param offset {Int} Zero-based rune offset. Negative or out-of-range offsets return an empty string. @param length {Int} Non-negative maximum rune count; omitted means the rest of the string. @return {String} A substring of value.
func Trim ¶
trim returns the string value with whitespace stripped from the start and/or end. @param str {String} The string. @param chars {String} Literal rune cutset. An empty cutset leaves the string unchanged. Omit to trim Unicode whitespace. @return {String} The string without chars on both sides.
Types ¶
This section is empty.