简体   繁体   English

忽略字符串中的特殊字符

[英]Ignore the special characters from the string

I am having a string which contains some special characters. 我有一个包含一些特殊字符的字符串。 ie "MCDO'S ". 即“ MCDO的”。 here in the code i am replacing it with the ascii html values like this. 在代码中,我用这样的ascii html值替换了它。

riDescription.replace("\"", "").replace("\\", "").replace("'", "'");

here ' is replaced by ' 在这里'替换为' Now the result which i am getting in UI is like this. 现在我在UI中得到的结果是这样的。

字符串与html值一起出现

Description.replace(“ \\”“,”“).replace(”'“,”'“);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM