why can i replace a single punctuation in java string code example Example: replace all punctuation in string java inputString.replaceAll("\\p{Punct}", "");