how to remove whitespace from string in java

www.‮al‬utturi.com
how to remove whitespace from string in java
/**
 * @author lautturi.com
 * Java example: java remove all whitespace from string 
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		String str = "hello 	lautturi java world!	";
		str = str.replaceAll("\\s+","");
		System.out.println(str);

	}
}

output:

hellolautturijavaworld!
Created Time:2017-09-13 12:09:08  Author:lautturi