replace characters rather than removing them