how to remove all punctuation from a string in java code example
Example 1: replace all punctuation in string java
inputString.replaceAll("\\p{Punct}", "");
Example 2: java string remove character
String str = "abcdDCBA123";
String strNew = str.replace("a", ""); // strNew is 'bcdDCBA123'
Example 3: java remove string from character
String str = "abcdDCBA123";
String strNew = str.replace("a", ""); // strNew is 'bcdDCBA123'