This function replaces the character at the specified index with a new character. The result is returned in a new string.$string.setCharAt(<inStr>, <index>, <char>)
inStrindex The index defining the position in the input string. The index is zero based which means the first character in the input string has the index 0.char
Example 89 #set($str='Hello World!')
#set($newStr=$string.setCharAt($str, 5, '-'))
Original string: $str
New string: $newStrOriginal string: Hello World!
New string: Hello-World!
| OpenText StreamServe 5.6.2 | Updated: 2018-01-26 |