This topic describes the syntax, description, parameters, and return values of string functions. This topic also provides examples of these functions.
substr
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Extracts parts from a string. |
Parameter |
|
Return value | Returns a substring |
Example |
|
concat
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Concatenates strings. |
Parameter | The strings that you want to concatenate. You can specify one or more strings. Numeric values are supported. |
Return value | Returns a concatenated string. |
Example |
Output:
|
upper
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Converts a string to uppercase letters. |
Parameter | s: the string that you want to convert. |
Return value | Returns the string specified by the |
Example |
Output:
|
lower
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Converts a string to lowercase letters. |
Parameter | s: the string that you want to convert. |
Return value | Returns the string specified by the |
Example |
Output:
|
len
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Queries the length of a string. |
Parameter | s: the string that you want to measure. |
Return value | Returns the length of the string specified by the |
Example |
|
byte
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Queries the ASCII value of a character. |
Parameter | c: the character whose ASCII value you want to query. You can specify only one character. |
Return value | Returns the ASCII value of the specified character. Data type: numeric. |
Example |
Output:
|
match_re
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Uses the Perl Compatible Regular Expressions (PCRE) engine for regular expression matching. For more information, see PCRE syntax. |
Parameter |
|
Return value | If the string matches the regular expression, |
Example |
Output:
|
capture_re
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Captures the matches of a string and returns the matching substrings. For more information about PCRE, see PCRE syntax. |
Parameter |
|
Return value | Returns the matching substrings in the dictionary type if the string matches the regular expression. Otherwise, an empty dictionary is returned. |
Example |
|
Response example |
|
gsub_re
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Replaces all matches of a string and returns the string after the replacement. For more information about PCRE, see PCRE syntax. |
Parameter |
|
Return value | Replaces all substrings that match the specified |
Example |
|
Response example |
|
split
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Splits a string into an array of substrings and returns the array. |
Parameter |
|
Return value | Returns an array of key-value pairs in the dictionary type. The value of the |
Example |
Request:
Output:
|
split_as_key
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Splits a string into an array of substrings and returns the array. |
Parameter |
|
Return value | Returns response parameters in the same way as the |
Example |
Request:
Output:
|
tohex
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Converts a string to a hexadecimal string. |
Parameter | s: the string that you want to convert. |
Return value | Returns a hexadecimal string that is converted from the string specified by the |
Example |
|
Response example |
|
tostring
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Converts data of any type to a string. |
Parameter | a: the data that you want to convert. Data type: any type. |
Return value | Returns a string that is converted from the value specified by the |
Example |
Output:
|
tochar
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description |
|
Parameter | nX: the integers that you want to convert. You can specify one or more integers. |
Return value | Returns a string that is converted from integers. |
Example |
Output:
|
reverse
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Reverses a string. |
Parameter | str: the string that you want to reverse. |
Return value | Returns a string reversed from the specified string. |
Example |
Output:
|
find
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Searches for a substring in a specified string. |
Parameter |
|
Return value |
|
Example |
Output:
|
format
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Formats the values of one or more parameters. The format string is the first parameter, which must specify a string. The format string follows the specification of the sprintf parameter used by functions in the C programming language. The syntax of a format string is: %[parameter][flag][field width][.precision]specifier.
|
Parameter |
|
Return value | Returns an ACSII string. |
Example |
Output:
|
tobin
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Converts a hexadecimal string to an ASCII string. |
Parameter | str: the hexadecimal string that you want to convert. It is not case-sensitive. |
Return value | Returns an ACSII string. |
Example |
Output:
|
trim
The following table describes the details about this function.
Feature | Description |
Syntax |
|
Description | Removes all whitespace characters before or after the string specified by the s parameter, and returns a string with the specified whitespace characters removed. |
Parameter |
|
Return value | Returns a string with the specified whitespace characters removed. |
Example |
Output:
|