Removing duplicate whitespace using regular expression
Written by coregps on December 14th, 2007 in Java.
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Just a simple note about how to remove duplicate whitespace using regular expression in java.
public class Test {
public static void main(String[] args) {
String str = "Hello World!";
System.out.println(str.replaceAll("\s+", " "));
}
}



































