Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Learn more about text functions CONCATENATE, JOIN, MATCH, FIND, FIRST, LAST, LENGTH, UPPERCASE, LOWERCASE, CAPITALIZE, TRIM, INDEXOF, LASTINDEXOF, SUBSTRING, SUBSTRING BEFORE, SUBSTRING AFTER, SPLIT, REPLACE, EQUALS. 

Overview

FunctionDescription

...

CONCATENATEUse the '+' (plus) operator to concatenate strings or a combination of strings and other type values to produce a single string value.

...

Syntax

...

...

string1 + string2 + ... + value1 + ...
  • string1 - The first string that you want to concatenate.
  • string2 - The second string that you want to concatenate.
  • value1 - A value of some type of number, date or boolean that you want to add to the new string value.

Return type

  • string

Examples

 

...

JOIN

Joins
UI Text Box
typeinfo

There exists a STR_CONCAT (string, string) function in the expression language. As it can only concatenate 2 strings, and is much longer in typing, we advise to use above way for concatenating strings.

 

JOIN

...

a series of values into one string, separated with a character of your choice

...

Syntax

Code Block
JOIN(argument1, argument2, ..., separator)
  • argument1, argument2 - Attributes or expressions that contain the values that will be joint to a single string. JOIN works for all base types, even multivalued.
  • separator - A string value that will be used as separator symbol.

Return type

  • string
UI Text Box
typenote
an UNKNOWN value will be represented as an empty entry in the result string.
UI Text Box
typenote

The CONCAT function is identical to the JOIN function.

Examples

...

.

 

...

 

 

...

 

MATCH

...

MATCHCompares

...

a string pattern to another string and returns TRUE if the string exactly matches the pattern, and otherwise FALSE. The MATCH function is case-sensitive

...

Syntax

Code Block
MATCH(pattern, string)

...

.

...

string - String value, attribute of base type string or an expression that results in a string value.
FINDLooks for a

Return type

  • boolean

Examples

If the attribute File.name is of base type string and its value is “Thisfile_1.doc” then

  • MATCH(“Thisfile_1.doc”, File.name) results in TRUE
  • MATCH(File.name, ”Thisfile_1.doc”) results in TRUE
  • MATCH(” Thisfile_1.doc”, File.name) results in FALSE
  • MATCH(“thisfile_1.doc”, File.name) results in FALSE
  • MATCH(“[A-Z]hisfile_1.doc”, File.name) results in TRUE
  • MATCH(“[a-z]hisfile_1.doc”, File.name) results in FALSE
  • MATCH(“Thisfile_[0-9].doc”, File.name) results in TRUE
  • MATCH("..............", File.name) results in TRUE
  • MATCH(".*", File.name) results in TRUE
  • MATCH("**", "**") results in an error message, because "**" is not a valid regular expression

FIND

...

string pattern within another string and returns the first matching characters. The function is case-sensitive.

Syntax

Code Block
FIND(pattern, attribute)
  • pattern - An attribute of base type string or a string value. String must be a valid regular expression. The regular expressions used in several Blueriq Studio functions are common Java 1.4 expressions. For a complete documentation we refer to the online java documentation.
  • attribute - An attribute of base type string or an expression that results in a string.

Return type

  • string

Examples

If File.name is an attribute of base type string with value “Thisfile_1.doc”, then:

  • FIND(“_[1-5]”, File.name) results in “_1”
  • FIND(“File”, File.name) results in UNKNOWN
  • FIND(“el”, “Hello”) results in “el”
  • FIND(“eo”, “Hello”) results in UNKNOWN

FIRST

...

FIRSTReturns the first character(s) of a string, based on the number of characters you specify.
LASTReturns the last character(s) of a string, based on the number of characters you specify.

Syntax

Code Block
FIRST integer CHARACTERS OF string
FIRST 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. FIRST CHARACTER OF can be used to retrieve only the first 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
typenote

If you prefer a functional syntax, you can use the STR_FRONT( string, integer ) function. Example: STR_FRONT("Blueriq", 3) = "Blu"

Examples

If File.name is an attribute of base type string with value “Thisfile_1.doc” and the integer attribute File.prefix has value 8 then:

  • FIRST File.prefix CHARACTERS OF File.name results in “Thisfile”
  • FIRST CHARACTER OF File.name results in “T”

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”

 

UI Text Box
typetip
use a combination of FIRST and LAST to retrieve a subset from inside a string.

 

LENGTHReturns the length of a string. 
UPPERCASEReturns a string with all characters in uppercase. 
LOWERCASEReturns a string with all characters in lowercase. 
CAPITALIZEReturns a string with the first character uppercased. 
TRIMStrips the leading and trailing spaces from a string. 
INDEXOFReturns the index of the first occurrence of a specified substring in a string.
LASTINDEXOFReturns the index of the last occurrence of a specified substring in a string. 
SUBSTRINGReturns the substring of a given string starting from the index provided and ending at the end index if provided, or the end of the string. 
SUBSTRING BEFOREReturns the start of a given string before the first occurrence of substring, or an empty string if substring is not found. 
SUBSTRING AFTERReturns the end of a given string after the first occurrence of substring, or an empty string if substring is not found. 
SPLITReturns a multivalued string attribute containing every substring that is delimited by the given pattern. 
REPLACEReplaces every occurrence of a string pattern within another string with a provided replacement string. The function is case-sensitive.
EQUALSCompares two strings and returns TRUE if and only if they are equal. This function is case sensitive.

Go here for more info on the Text Substitution Language (TSL) documentation

Functions

Include Page
Text function CONCATENATE
Text function CONCATENATE


Include Page
Text function JOIN
Text function JOIN


Include Page
Text function MATCH
Text function MATCH


Include Page
Text function FIND
Text function FIND


Include Page
Text function FIRST
Text function FIRST


Include Page
Text function LAST
Text function LAST


Include Page
Text function LENGTH
Text function LENGTH


Include Page
Text function UPPERCASE
Text function UPPERCASE


Include Page
Text function LOWERCASE
Text function LOWERCASE


Include Page
Text function CAPITALIZE
Text function CAPITALIZE


Include Page
Text function TRIM
Text function TRIM


Include Page
Text function INDEXOF
Text function INDEXOF


Include Page
Text function LASTINDEXOF
Text function LASTINDEXOF


Include Page
Text function SUBSTRING
Text function SUBSTRING


Include Page
Text function SUBSTRING BEFORE
Text function SUBSTRING BEFORE


Include Page
Text function SUBSTRING AFTER
Text function SUBSTRING AFTER


Include Page
Text function SPLIT
Text function SPLIT


Include Page
Text function REPLACE
Text function REPLACE


Include Page
Text function EQUALS
Text function EQUALS

LAST

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
typenote

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
typenote

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( "hello" ) = "HELLO"

  • UPPER( "WORLD" ) = "WORLD"

  • UPPER( "hello world " ) = "HELLO WORLD "

  • UPPER( " hELLo " ) = " HELLO "

  • 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( "WORLD" ) = "world"
  • LOWER( "Hello World " ) = "hello world "
  • LOWER( " hELLo " ) = " 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 - An attribute of base type boolean, an expression that results in a boolean or a constant boolean value, 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( "hello world " ) = "Hello world "

  • CAPITALIZE( " hELLo " ) = " hELLo "

    UI Text Box
    typenote

    The input string is not trimmed, so in this case the first character is a space.

  • CAPITALIZE( "hello" , TRUE ) = "Hello"
  • CAPITALIZE( "WORLD" , TRUE ) = "World"

  • CAPITALIZE( "hello world " , TRUE ) = "Hello world "

  • CAPITALIZE( " hello " , TRUE ) = " hELLo "

    UI Text Box
    typenote

    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( ? ) = ?

SUBSTRING

SUBSTRING returns the substring of a given string starting from the index provided and ending at the end index if provided, or the end of the string

Syntax

Code Block
SUBSTRING ( string , startIndex )
SUBSTRING ( string, startIndex, endIndex )
  • string - An attribute of base type string, an expression that results in a string or a constant string value.
  • startIndex - A positive integer value indicating at which character the substring should start (inclusive). This can be either an attribute of base type integer, an expression that results in an integer or a constant integer value. The first character starts at index 0.
  • endIndex - A positive integer value indicating at which character the substring should end (exclusive). This can be either an attribute of base type integer, an expression that results in an integer or a constant integer value. The endIndex cannot exceed the length of the string.

Return type

  • string

Example

...

SUBSTRING( "Hello world" , 1 ) = "ello world"

...