Syntax
set aSubstring = aString.substring(startIndex, length)
set aSubstring = substring(LITERAL, startIndex, length)
SemanticsExtracts a substring of a given length beginning at position startIndex. Returns a new string. The state of the current string is not changed. If length is greater than the length of aString, an error is raised.
Substitutables

aStringCan be any variable or object attribute having the type String.  
startIndex, lengthCan be any variable or object attribute having the type Integer. The start index cannot be negative.
LITERALString literal.
Examples
set aSubstring = stringSet.s1.substring(0, 2);

// To get the last 5 characters of a string
set endOfString = astring.substring(aString.length(-5), 5);
  • No labels