SUBSTRING2 Function
Description: Returns a string containing a portion of the source string. The substring begins at the specified start character number and extends to the specified end character number.
Parameters: String, Integer, Integer
- Source text: The string containing the source value.
- Start: The number of the starting character to be returned. The first character is number 1, the second character is number 2, etc.
- End: The number of the ending character, which is included in the returned substring. For example, if you specify 10 as the number of the end character, the last character included in the substring is the 10th character.
Return: String containing the requested portion of the source text. If the source value is shorter than the requested start, an index error will be returned. If the source value is shorter than the requested end, the characters from the start to the end of the source value will be returned.
Syntax: SUBSTRING2 (<source text>,<start>,<end>)
Example: Set the value in String 8 sub 2 to characters 3 through 7 of String 8; specifying start at character 3 and end at character 7.
DE("String 8 sub 2").setValue
( SUBSTRING2( DE("String 8").getValue( ), 3, 7 ) );
{{export-indexterm primary="SUBSTRING2 function"/}}