我需要帮助替换字符串中的所有单引号。
这是我的字符串:The State of the water = 'ICE'
我想要移除'ICE'周围的单引号。
str = str.replaceAll("\'","");
replace
而不是replaceAll
。命名不幸,但replace
也会替换所有出现的内容。 - undefinedString str = "The State of the water = 'ICE'";
str = str.replaceAll("'","");
replace
而不是replaceAll
。命名不幸,但replace
也会替换所有出现的内容。 - undefined
String.replace()
方法了吗? - Codebender