【发布时间】:2014-08-26 18:13:50
【问题描述】:
例子:
String s1 = JOptionPane.showInputDialog("enter the string");
String s2 = "h2ow |are you";
if (s2.replace all("\\d+","").replaceAll("|", "").contains(s1))
JOptionPane.showMessageDialog(null, "true");
else
JOptionPane.showMessageDialog(null, "false");
如果我输入输入为“如何”输出为真
但是,当我输入“how are”时,输出为假。
有没有办法替换'|'(竖线)?
【问题讨论】: