remove all white spaces from string in java

remove all white spaces from string in java
/**
 * @author lautturi.com 
 * Java example: Java remove white spaces from string 
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		String str = " hello 	lautturi world \r\n" + 
				" java world";
		System.out.println(str);
		str = str.replaceAll("\\s+","");
		System.out.println(str);
	}
}
Sourc‮e‬:www.lautturi.com

output:

hello 	lautturi world 
 java world
 
hellolautturiworldjavaworld
Created Time:2017-09-28 17:13:46  Author:lautturi