Product Site

5.1.7.61. delStr

Returns a copy of the receiving string after deleting the substring that begins at the nth character and is of length characters. If n is omitted, it defaults to 1. If you omit length, or if length is greater than the number of characters from n to the end of string, the method deletes the rest of string (including the nth character). The length must be a positive whole number or zero. The n must be a positive whole number. If n is greater than the length of the receiving string, the method returns the receiving string unchanged.
Example 5.99. String class — delStr method
Say "abcd"~delStr(3)       -->    "ab"
Say "abcde"~delStr(3,2)    -->    "abe"
Say "abcde"~delStr(6)      -->    "abcde"