Java delete the last character of String

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

import java.util.*;

public class Lautturi {
	public static String removeLastChar(String s) {
	    return (s == null || s.length() == 0)
	      ? null
	      : (s.substring(0, s.length() - 1));
	}
	
	public static void main(String[] args) {
		String str = "welcom to java world.!";

		System.out.println(str);
		str = removeLastChar(str);
		System.out.println(str);
	}
}
Source‮ww:‬w.lautturi.com

output:

welcom to java world.!
welcom to java world.
Created Time:2017-09-28 21:56:13  Author:lautturi