Java remove white spaces at beginning and end of string

Java remove white spaces at beginning and end of string
refer t‮uttual:o‬ri.com
/**
 * @author lautturi.com 
 * Java example: remove white spaces at beginning and end of string in java
 */


import java.util.*;

public class Lautturi {
	public static void main(String[] args) {

		String str = "  hello java 	\n  ";
		String newString = str.trim();
		System.out.println(newString);
	}
}

output:

hello java
Created Time:2017-10-07 17:35:32  Author:lautturi