本文介绍了如何用Java中的空格替换双引号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如:
"I don't like these "double" quotes"
我希望输出
I don't like these double quotes
推荐答案
使用。
用空格替换它们(根据你的问题标题):
To replace them with spaces (as per your question title):
System.out.println("I don't like these \"double\" quotes".replace("\"", " "));
以上也可以用字符:
System.out.println("I don't like these \"double\" quotes".replace('"', ' '));
删除它们(根据你的例子):
To remove them (as per your example):
System.out.println("I don't like these \"double\" quotes".replace("\"", ""));
这篇关于如何用Java中的空格替换双引号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!