This function returns a new string which is a substring of the input string. The substring is specified by a start index and optionally an end index.$string.substring(<inStr>, <startIndex>[, <endIndex>])
inStrstartIndex The start index (zero based) that specifies the first character to include in the substring.endIndex Optional end index (zero based) that specifies the end of the substring. This index is the position of the first character after the substring, i.e. the first character to exclude from the substring.If not set, the substring will include everything from startIndex to the end of the input string.
Note: The index must not be < startIndex or > string.length.
Example 102 #set($str='Hello My Cruel World!')
#set($subStr=$string.substring($str, 6))
Original string: $str
Substring: $subStrOriginal string: Hello My Cruel World!
Substring: My Cruel World!
Example 103 #set($str='Hello My Cruel World!')
#set($subStr=$string.substring($str, 6, 14))
Original string: $str
Substring: $subStrOriginal string: Hello My Cruel World!
Substring: My Cruel
| OpenText StreamServe 5.6.2 | Updated: 2018-01-26 |