Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 351 Bytes

remove-punctuation.md

File metadata and controls

15 lines (13 loc) · 351 Bytes
title description author tags
Remove Punctuation
Removes punctuation (, . !) from a string
Mcbencrafter
string,punctuation,clean,normalization
public static String removePunctuation(String text) {
    return text.replaceAll("[,!.?;:]", "");
}

// Usage:
System.out.println(removePunctuation("hello, world!")); // "hello world"