java remove last character from string

java remove last character from string
/**
 * @author lautturi.com 
 * Java example: remove the last character of string in java
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		String str = "Hello World!";

		System.out.println(str);
		str = str.substring(0, str.length()-1);
	    
		System.out.println(str);
	}
}
‮S‬ource:www.lautturi.com

output:

Hello World!
Hello World
Created Time:2017-09-28 16:58:53  Author:lautturi