java get the last character of a string

https://‮w‬ww.lautturi.com
java get the last character of a string
/**
 * @author lautturi.com 
 * Java example: check the last char of string
 */

import java.math.BigInteger;
import java.util.*;

public class Lautturi {
	public static void main(String[] args) {
		String str = "Lautturi";
		System.out.println("last char = " + str.charAt(str.length() - 1));
	}
}
Created Time:2017-10-03 14:39:04  Author:lautturi