remove all punctuation from end of string java code example Example: java remove punctuation from string inputString.replaceAll("\\p{Punct}", "");