Example:
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");
If I enter input as "how" the output is true
but, when I enter "how are" the output is false.
Is there a method to replace '|'(vertical bar)?