Page History
...
LAST returns the last character(s) of a string, based on the number of characters you specify.
Syntax
Code Block |
---|
LAST integer CHARACTERS OF string LAST CHARACTER OF string |
- integer - A positive integer value. This can be either an attribute of base type integer, an expression that results in an integer or a constant integer value. LAST CHARACTER OF can be used to retrieve only the last character of the string.
- string - An attribute of base type string, an expression that results in a string or a constant string value.
Return type
- string
UI Text Box | ||
---|---|---|
| ||
If you prefer a functional syntax, you can use the STR_BACK ( string, integer ) function. Example: STR_BACK("Blueriq", 3) = "riq" |
Examples
If File.name is an attribute of base type string with value “Thisfile_1.doc” and the integer attribute File.extension has value 3 then:
- LAST File.extension CHARACTERS OF File.name results in “doc”
- LAST CHARACTER OF File.name results in “c”
Example
- FIRST 2 CHARACTERS OF (LAST 6 CHARACTERS OF “pieceofcake”) results in “of”
- LAST 3 CHARACTERS OF (FIRST 4 CHARACTERS OF “what's in a name”) results in “hat”
LENGTH
LENGTH returns the length of a string
Syntax
Code Block |
---|
LENGTH ( string ) |
- string - An attribute of base type string, an expression that results in a string or a constant string value.
Return type
- integer
UI Text Box | ||
---|---|---|
| ||
Spaces at the start of the end of the string are counted as well, the string is not trimmed. |
Example
- LENGTH( "Blueriq" ) = 7
- LENGTH( " Blueriq " ) = 9
- LENGTH( ? ) = ?
UPPER
UPPER returns a string with all characters in uppercase
Syntax
Code Block |
---|
UPPER ( string ) |
- string - An attribute of base type string, an expression that results in a string or a constant string value.
Return type
- string
Example
UPPER( "
Blueriqhello" ) = "HELLO"
UPPER( "WORLD" ) = "
BLUERIQWORLD"
UPPER( "
BlueriQ hello world " ) = "
BLUERIQ HELLO WORLD "
UPPER( "
BLUERIQhELLo " ) = "
BLUERIQHELLO "
- UPPER( ? ) = ?
LOWER
LOWER returns a string with all characters in lowercase
Syntax
Code Block |
---|
LOWER ( string ) |
- string - An attribute of base type string, an expression that results in a string or a constant string value.
Return type
- string
Example
- LOWER( "hello" ) = "hello"
- LOWER( " Blueriq
- WORLD" ) = " blueriq
- world"
- LOWER( " BlueriQ Hello World " ) = " blueriq hello world "
- LOWER( "blueriq hELLo " ) = "blueriq hello "
- LOWER( ? ) = ?
CAPITALIZE
CAPITALIZE returns a string with the first character uppercased
Syntax
Code Block |
---|
CAPITALIZE ( string ) CAPITALIZE ( string, lowerTheRest ) |
- string - An attribute of base type string, an expression that results in a string or a constant string value.
- lowerTheRest - A boolean or expression that results in a boolean, indicating that the other characters need to be lowercased. This parameter is optional and if it is not supplied, the other characters are left untouched.
Return type
- string
Example
- CAPITALIZE( "hello" ) = "Hello"
CAPITALIZE( "WORLD" ) = "WORLD"
CAPITALIZE( "
blueriqhello world " ) = "
BlueriqHello world "
CAPITALIZE( " blueriQ hELLo " ) = " blueriQ hELLo "
UI Text Box type note The input string is not trimmed, so in this case the first character is a space.
- CAPITALIZE( "hello" , TRUE ) = "Hello"
CAPITALIZE( "
bluerRIQWORLD" , TRUE ) = "
BlueRIQWorld"
CAPITALIZE( "
bluerRIQhello world " ,
TRUETRUE ) = "
Blueriq"CAPITALIZEHello world "
CAPITALIZE( " hello " , TRUE ) = " hELLo "
UI Text Box type note The input string is not trimmed, so in this case the first character is a space.
- CAPITALIZE( ? ) = ?
TRIM
TRIM strips the leading and trailing spaces from a string
Syntax
Code Block |
---|
TRIM ( string ) |
- string - An attribute of base type string, an expression that results in a string or a constant string value.
Return type
- string
Example
- TRIM( "Hello" ) = "Hello"
- TRIM( "Hello World" ) = "Hello World"
- TRIM( " Hello World " ) = "Hello World"
- TRIM( ? ) = ?