2010-11-25 152 views

回答

0
String withQuotes = "I am a \" quote"; 
String withoutQuotes = withQuotes.replace("\"",""); 
5
String s = "Hello \"there\""; 
s = s.replaceAll("\"", ""); 
+0

謝謝..它工作正常。 – Tanu 2010-11-25 10:58:31

1

使用Guava庫:

String s = "Hello \"world\""; 
s=CharMatcher.is('\"').removeFrom(s); // '\"' --> Escape the double quote(") using \ 
當你刪除一個字符串的特定字符
+0

對不起,但它不起作用 – Tanu 2010-11-25 10:14:10