You are viewing the documentation for Blueriq 16. Documentation for other versions is available in our documentation directory.

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

SUBSTRING ( string , startIndex )
SUBSTRING ( string , startIndex , endIndex )


Inputs

  • 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 and should be larger than the startIndex.


Return type

  • string


Example

ExpressionResultType
SUBSTRING ( "Hello world" , 1 )"ello world"String
SUBSTRING ( "Hello world" , 0 , 1 )"H"String
SUBSTRING ( "Hello world" , 1 , 5 )"ello"String
SUBSTRING ( "Hello world" , 0 )"Hello world"String
SUBSTRING ( "Hello world" , 0 , LENGTH( "Hello world" ) )"Hello world"String



Back to Top