how to ignore punctuation and space in array java code example Example: replace all punctuation in string java inputString.replaceAll("\\p{Punct}", "");