<< Click to Display Table of Contents >> Text |
Functions |
Syntax |
Instructions |
Examples |
---|---|---|---|
ascii |
ascii(string) |
Returns the ascii code for the first character of the string |
For example: ascii('A') = 65 |
char |
char(number) |
Returns the character encoded by the ascii code number |
For example: char(65) = 'A' |
concat |
concat(string1,string2..) |
Concatenate multiple strings |
For example:concat("yonghong","company")=yonghongcompany |
contains |
contains(string, substring) |
Returns true if the string contains the specified substring |
For example: contains("Calculation", "alcu") = true |
endsWith |
endsWith(string, substring) |
Returns true if the given string ends with the specified substring |
For example: endsWith("yonghong", "ghon")=false |
exact |
exact(string1,string2) |
Compares whether two strings are the same, returns true if they are the same, and returns false if they are different string1 The string 1 to be compared string2 The string 2 to be compared |
For example: exact("Hello World Java", "Hello World Java")=true |
extractNTH |
extractNTH(string, regex, index) |
Matches a regular expression against the source string and returns the corresponding substring string The string to be processed regex needs to match a regular expression, such as matching whitespace characters: "\s" index needs to return the nth capture group that matches, if it is 0, it returns the entire string |
For example: Get the matching second capture group "World", as shown below extractNTH("Hello World", "([A-z]+)\\s+([A-z]+)", 2)=World |
find |
find(string, substring, [start]) |
Returns the index position of substring in string, or 0 if substring is not found. If the optional parameter start is added, the function ignores the occurrences before the index position start Any instance of substring. The position of the first character in the string is 1
|
For example: find("Calculation", "alcu") = 2 |
indexOf |
indexOf(string, substring) |
Returns the index position of substring in string. Returns 0 if no substring is found |
For example: indexOf("hello world", "o")=5 |
left |
left(string, number) |
Returns a certain number of characters to the left of the string |
For example: left("matador", 4) = "mata" |
len |
len(string) |
Returns the length of the string |
For example: len("matador") = 7 |
lower |
lower(string) |
Returns string with all characters in lower case |
For example: lower("ProductVersion") = productversion |
match |
match(string, regex) |
Returns true if the source string matches the regular expression, otherwise returns false string, the string to be processed regex needs to match a regular expression, such as matching whitespace characters: "\s" |
For example: If the source string matches a regular expression, it returns true match("Hello World","([A-z]+)\sWorld")=true |
mid |
mid(string, start,[length])
|
Returns a string starting at index position start. The first character in the string is at position 1. If the optional parameter length is added, the returned string contains only that number of characters |
For example: mid("calculation", 2) = "alculation" mid("calculation", 2, 5) ="alcul" |
replace |
replace(string, substring, replacement) |
Search for substring in string and replace it with replacement. If no substring is found, the string remains unchanged |
For example: replace("version8.5", "8.5", "9.0") = "version9.0" |
replaceRegex |
replaceRegex(string,regex,replacement) |
Matches a regular expression against the source string and returns the replaced string string The string to be processed regex needs to match a regular expression, such as matching whitespace characters: "\s" replacement The replacement string |
For example: Replace spaces with "*" and return the string "hello * world": replaceRegex("hello world", "\s", "*") = hello * world |
rept |
rept(string,number) |
Repeats a string a specified number of times string The string to be processed number The number of times to repeat |
For example: rept("*-", 3)=*-*-*- |
right |
right(string, number) |
Returns the rightmost number of characters in string |
For example: right("calculation", 4) = tion |
search |
search(find_string, with_string, [start_num] ) |
Returns the position where a string first appears in another string(case-insensitive) find_string The string to find with_string The searched string start_num Optional parameter,where to start the search.The default is 1 |
For example: Find the string "o" starting from the 6th position of the string, and return the position 8: search("o", "hello world", 6)=8 |
split |
split(string, delimiter, token number) |
Returns a substring in a string and divides the string into a series of tokens using a delimiter character |
For example: split('a-b-c-d','-', 2) = b |
startsWith |
startsWith(string, substring) |
Returns true if string starts with substring. Leading spaces are ignored |
For example: startsWith("Yonghong", "Yon")=true |
substitute |
substitute(string, old_str, new_str, times) |
Replace part of the source string with a new string string The string to be processed old_str The string to be replaced new_str Replaced string times optional parameter, the replacement string, default 0 |
For example: How to replace the "world" string with "earth" once and return the string "hello earth hello world": substitute("hello world hello world", "world", "earth", 1) = hello earth hello world |
substring |
substring(string, start_position, [length]) |
Returns a subset of the string at a specified position string: the given string start_position: a non-negative integer specifying the position of the first character of the substring to be extracted in the given string length: Optional, non-negative integer. If this parameter is omitted, the returned substring will continue to the end of the string |
For example: substring("Hello World",1, 3)=Hel |
trim |
trim(string) |
Returns a string with leading and trailing spaces removed |
For example: trim(" calculation ") = "calculation" |
upper |
upper(string) |
Returns a string with all characters in uppercase |
For example: upper("calculation") = "CALCULATION" |