|
replaceAt
>>-replaceAt(new-,-n-,-+----------+-+-------+-)-----><
+-,-length-+ +-,-pad-+
Returns a copy of the receiving string, with the characters from the [n] th character for [length] characters replaced with [new] . The replacement position and length can extend beyond the end of the receiving string. The starting position, [n] , is required and must be a positive whole number. The [length] argument is opitonal must be a positive whole number or zero. If omitted, [length] defaults to the length of [new] . If [n] is greater than the length of the receiving string, padding is added before the [new] string. The default [pad] character is a blank. String class - replaceAt method
"abcdef"~replaceAt(" ",3, 1) -> "ab def"
"abcdef"~replaceAt(" ",3, 3) -> "ab f"
"abc"~replaceAt("123",5,6,"+") -> "abc+123"
|