Optimized remove_char.