Remove part of string

Syntax

s.remove(from [nc])

 

Parameters

s - str variable.

from - 0-based index of first character to remove.

nc - number of characters to remove. Default: -1 (remove all characters at right (like str.fix)).

 

Remarks

Removes nc characters from middle of s.

 

Example

str s = "My dog and cat"
s.remove(2 8)
 now s is "My cat"