如何在字符串中替换ï¿ [英] How to replace � in a string

查看:702
本文介绍了如何在字符串中替换ï¿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含字符的字符串,我无法正确地替换它。

I have a string that contains a character � I haven't been able to replace it correctly.

String.replace(� );

String.replace("�", "");

不工作,有没有人知道如何删除/替换字符串中的¿?

doesn't work, does anyone know how to remove/replace the � in the string??

推荐答案

这是Unicode替换字符\\\�。 (信息

That's the Unicode Replacement Character, \uFFFD. (info)

这样的东西应该可以工作:

Something like this should work:

String strImport = "For some reason my �double quotes� were lost.";
strImport = strImport.replaceAll("\uFFFD", "\"");

这篇关于如何在字符串中替换ï¿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆