btrim()
Removes characters from both ends of a given string until encountering a character that is not contained in the specified set of characters.
| Syntax | btrim(<str>[, <chars>]) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The original string | |
<chars> |
STRING |
The set of characters to look for; it defaults to a space | |
| Return Type | STRING |
||
RETURN btrim(" Ultipa Graph ") AS newString
Result:
| newString |
|---|
Ultipa Graph |
RETURN btrim("123ABC341", "123") AS newString
Result:
| newString |
|---|
| ABC34 |
char_length()
Returns the number of characters in a string.
character_length()is a synonym tochar_length().
| Syntax | char_length(<str>) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The input string | |
| Return Type | UINT |
||
RETURN char_length("Ultipa Graph")
Result:
| char_length("Ultipa Graph") |
|---|
| 12 |
left()
Returns a substring of the given string containing the specified number of leftmost characters.
| Syntax | left(<str>, <length>) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The original string | |
<length> |
UINT |
Length of the substring | |
| Return Type | STRING |
||
RETURN left("Ultipa Graph", 6)
Result:
| left("Ultipa Graph", 6) |
|---|
| Ultipa |
lower()
Converts all the characters in a given string to lowercase.
| Syntax | lower(<str>) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The original string | |
| Return Type | STRING |
||
RETURN lower("Ultipa Graph")
Result:
| lower("Ultipa Graph") |
|---|
| ultipa graph |
ltrim()
Removes characters from the begining of a given string until encountering a character that is not contained in the specified set of characters.
| Syntax | ltrim(<str>[, <chars>]) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The original string | |
<chars> |
STRING |
The set of characters to look for; it defaults to a space | |
| Return Type | STRING |
||
RETURN ltrim(" Ultipa Graph ") AS newString
Result:
| newString |
|---|
Ultipa Graph |
RETURN ltrim("124ABC341", "123") AS newString
Result:
| newString |
|---|
| 4ABC341 |
normalize()
Converts a string into a consistent format based on the normalization form specified, in accordance with Unicode Standard Annex #15.
This function is typically used to compare two strings by their Unicode codepoints. Two characters appear identical to human eyes may have different codepoints, such as the multiplication sign × (U+00D7) and the letter x (U+0078).
| Syntax | normalize(<str>[, <form>]) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The original string | |
<form> |
/ | The normalzation form (NF) keyword:
|
|
| Return Type | STRING |
||
RETURN normalize('×') = normalize('x') AS result
Result:
| result |
|---|
| 0 |
replace()
Returns a string where all occurrences of a specified substring are replaced with another string.
| Syntax | replace(<str>, <find>, <replace>) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The original string | |
<find> |
Textual | The substring to search for within the original string. | |
<replace> |
Textual | The new string that replaces each occurrence of the search string. | |
| Return Type | STRING |
||
RETURN replace("hello world", "world", "graph") AS result
Result:
| result |
|---|
| hello graph |
right()
Returns a substring of the given string containing the specified number of rightmost characters.
| Syntax | right(<str>, <length>) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The original string | |
<length> |
UINT |
Length of the substring | |
| Return Type | STRING |
||
RETURN right("Ultipa Graph", 5)
Result:
| right("Ultipa Graph", 5) |
|---|
| Graph |
rtrim()
Removes characters from the end of a given string until encountering a character that is not contained in the specified set of characters.
| Syntax | rtrim(<str>[, <chars>]) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The original string | |
<chars> |
STRING |
The set of characters to look for; it defaults to a space | |
| Return Type | STRING |
||
RETURN rtrim(" Ultipa Graph ") AS newString
Result:
| newString |
|---|
Ultipa Graph |
RETURN rtrim("123ABC4321", "123") AS newString
Result:
| newString |
|---|
| 123ABC4 |
split()
Returns a list of string resulting from the splitting of the given string around matches of the given delimiter.
| Syntax | split(<str>, <delimiter>) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The original string | |
<delimiter> |
Textual | The delimiter string with which to split the original string. | |
| Return Type | LIST<STRING> |
||
RETURN split("apple,banana,grape", ",")
Result:
| split("apple,banana,grape", ",") |
|---|
| ["apple","banana","grape"] |
RETURN split("[email protected]", "@")[0] AS username
Result:
| username |
|---|
| appleLEE |
substring()
Returns a substring of a given length from the given string, beginning with a 0-based index start.
| Syntax | substring(<str>, <startIndex>, <length>) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The original string | |
<startIndex> |
Integer | The start position of the new string. | |
<length> |
Integer | The length of the substring. | |
| Return Type | STRING |
||
RETURN substring("crystal hawk river", 0, 7) AS subText
Result:
| subText |
|---|
| crystal |
trim()
Removes all the occurrences of the specified single character from either the leftmost, rightmost, or both ends of a given string.
| Syntax | trim([[<spec>] [<char>] FROM] <str>) |
|||
| Arguments | Name | Type | Description | Note |
<spec> |
/ | The trim specification keyword:
|
If FROM is specified, then at least one of <spec> and <char> shall be specified. |
|
<char> |
STRING |
The character to look for; it defaults to a space | ||
<str> |
Textual | The original string | / | |
| Return Type | STRING |
|||
RETURN trim(" Ultipa Graph ") AS newString
Result:
| newString |
|---|
Ultipa Graph |
RETURN trim(BOTH "a" FROM "aaGraph DBa") AS newString
Result:
| newString |
|---|
| Graph DB |
RETURN trim(LEADING "a" FROM "aaGraph DBa") AS newString
Result:
| newString |
|---|
| Graph DBa |
RETURN trim(TRAILING FROM " Graph DB ") AS newString
Result:
| newString |
|---|
Graph DB |
upper()
Converts all the characters in a given string to uppercase.
| Syntax | upper(<str>) |
||
| Arguments | Name | Type | Description |
<str> |
Textual | The original string | |
| Return Type | STRING |
||
RETURN upper("Ultipa Graph")
Result:
| upper("Ultipa Graph") |
|---|
| ULTIPA GRAPH |