Character deletion logic