Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 24.0
Syntax
Code Block
languagenone
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
Code Block
languagenone
set aSubstring = stringSet.s1.substring(0, 2);

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