OPAL String Functions

String functions process strings as input, or provide strings as output.

Function

Description

array_to_string

Cast all values in an array to string and concatenate them, optionally adding a separator between each value.

concat_strings

Return the concatenation of all string arguments.

decode_base64

DecodeBase64 decodes a base64 encoded input

decode_uri

Replace %-encoded escape sequences in a string with unencoded plain text.

decode_uri_component

Replace all %-encoded escape sequences in a string with unencoded plain text.

detect_browser

Identify the browser used for a web request from its User-Agent header.

editdistance

Returns the Levenshtein distance between str1 and str2.

embed_sql_params

Embed parameters into the given prepared SQL statement by replacing occurrences of the placeholder character ‘?

encode_base64

EncodeBase64 encodes the input in the base64 format

encode_uri

Replace certain characters in a string with %-encoded escape sequences.

encode_uri_component

Replace certain characters in a string with %-encoded escape sequences.

format_time

Format the timestamp value in UTC according to the specified format.

get_regex

Returns a string that matches the given regular expression (which may be null if nothing matches.

get_regex_all

Returns an array containing all parts of the argument string that match the given regular expression (which may be empty if

int64_to_ipv4

Given an integer that represents an IPv4 address in big-endian (network) byte order, return the corresponding dotted-quad

left

Returns a leftmost substring of its input.

like

Returns true if subject matches pattern (case-sensitive).

lower

Return the input string in lowercase.

lpad

Left pads a string with characters from another string, default pad string is whitespace

ltrim

ltrim removes leading characters from a string.

match_regex

Return true if the argument input string or object (converted to a string) matches the argument regular expression.

parse_csv

Parses an input string as character-separated values, where the default separator is a comma (comma-separated values.

parse_kvs

Returns an object of key=value pairs extracted from an input string.

parse_timestamp

Parse a string value, whose format is specified by the format argument, as a timestamp.

pivot_array

Converts an array of “key”-“value” pairs into an object with key-value attributes.

position

Searches for the first occurrence of the second argument (needle) in the first argument (haystack) and, if successful, returns the

regex

Coerce a string literal to a regular expression.

replace

Replaces all instances of the substring in the input string with a provided value.

replace_regex

Replaces all instances of a matched regex pattern in the input string with a provided value.

right

Returns a rightmost substring of its input.

rpad

Right pads a string with characters from another string, default pad string is whitespace

rtrim

rtrim removes trailing characters from a string.

search

Return true if the for text is matched in the input string in (case-insensitive).

split

Splits the string into an array, based on the separator.

split_part

Splits a given string at a specified character and returns the requested part.

starts_with

Returns true if string starts with expr.

string

Generate a string representation of the argument value.

string_agg

Returns concatenated input values, separated by the delimiter.

string_agg_distinct

Returns concatenated input values, separated by the delimiter.

string_null

Returns a null value of type string.

substring

Extracts characters from a string, starting at an index.

tokenize

Splits the string into an array based on separator, which is treated as a set of characters.

tokenize_part

Tokenizes the input string using the delimiter and returns the requested part.

trim

trim removes leading and trailing characters from a string.

unpivot_array

Convert an object into an array of “key”-“value” pairs.

upper

Return the input string in uppercase.

variant_type_name

Given a variant value (typically, something you get from looking up a path or element in a JSON object or array,) determine what