java remove spaces at beginning and end of string

java remove spaces at beginning and end of string
/**
 * @author lautturi.com 
 * Java example:  remove white spaces at beginning and end of string
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		String str = "   hello lautturi java world   ";
		
		System.out.println(str);
		str = str.trim();
		System.out.println(str);
	}
}
Source‮:‬www.lautturi.com

output:

,   hello lautturi java world   
hello lautturi java world
Created Time:2017-09-28 17:16:12  Author:lautturi