character replace implement