The REPLACE
function replaces
Replaces every occurrence of a string pattern within another string with a provided replacement string. The function is case-sensitive.
Syntax Code Block |
---|
REPLACE pattern IN string WITH replacement
REPLACE ( pattern , string , replacement ) |
|
The Studio functions
Return type
Examples Expression | Result | Type |
---|
REPLACE ":" IN "hello:world:example" WITH " " | "hello world example" | String | REPLACE ( "o" , "hello world" , "a" ) | "hella warld" | String | REPLACE ( "O" , "hello world" , "a" ) | "hello world" | String | REPLACE "\s" IN "hello world example" WITH "" | "helloworldexample" | String | REPLACE ( "\d{2}" , "hello1 world22 example333" , "@" ) | "hello1 world@ example@3" | String | REPLACE ( "" , "hello world" , " " ) | " h e l l o w o r l d " | String | REPLACE "\s" IN "hello world example" WITH "\s" | "hello\sworld\sexample" | String |
|
UI Text Box |
---|
type | note Info |
---|
The first argument is a pattern (regular expression) and can therefore contain specials like \s for a space. The second and third arguments are strings or expressions, so \s will result in \s |
|
. Panel |
---|
|
EQUALS
EQUALS
compares two strings and returns TRUE if and only if they are equal. This function is case sensitive.
UI Text Box |
---|
|
Only use this function if you need a case sensitive comparison of two strings. If you want to compare strings case insensitive, use the '=' operator instead. |
Syntax
Code Block |
---|
string1 EQUALS string2
EQUALS ( string1 , string2 ) |
Inputs
string1 - An attribute of base type string, an expression that results in a string or a constant string valuestring2 - An attribute of base type string, an expression that results in a string or a constant string value.Return type
Example
Expression | Result | Type | Note |
---|
"hello" EQUALS "hello" | TRUE | Boolean | EQUALS ( "hello" , "Hello" ) | FALSE | Boolean | FALSE because EQUALS is case sensitive |
"hello" EQUALS "hello " | FALSE | Boolean | FALSE because of trailing space |
EQUALS ( "" , "" ) | TRUE | Boolean