Replace the range of characters from index1 up to but not including index2 with chars. This is equivalent to a delete() followed by an insert() at index1; args is interpreted as for insert().
tkinter/Text.replace
Text.replace