Skip to content

Instantly share code, notes, and snippets.

@William-Lake
Last active May 4, 2021 14:34
Show Gist options
  • Save William-Lake/f04a7cb4e59ef8eab87db828dccef4b6 to your computer and use it in GitHub Desktop.
Save William-Lake/f04a7cb4e59ef8eab87db828dccef4b6 to your computer and use it in GitHub Desktop.
Java - Use .replaceAll() to remove punctuation from String via regex.
word = word.replaceAll("\\p{Punct}+", "");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment