Strings commands
The strsub command replaces the characters
from first to last in string1
with the contents of string2
.
strsub string1 first last ?string2?
- If
string2
is not present, then an empty string is used. This effectively deletes the specified characters. Bothfirst
andlast
can be specified asend
, or any abbreviation of it, to refer to the last character instring2
. - If
first
is less than zero, then it is treated as if it were zero. Iflast
is greater than or equal to the length of the string, then it is treated as if it wereend
. It is an error forfirst
to be greater thanlast
.
This command returns the modified string.