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. Both first and last can be specified as end, or any abbreviation of it, to refer to the last character in string2.
  • If first is less than zero, then it is treated as if it were zero. If last is greater than or equal to the length of the string, then it is treated as if it were end. It is an error for first to be greater than last.

This command returns the modified string.