Here you can find the source of lastIndexOfLetter(String string)
public static int lastIndexOfLetter(String string)
//package com.java2s; public class Main { public static int lastIndexOfLetter(String string) { for (int i = 0; i < string.length(); i++) { char character = string.charAt(i); if (!Character.isLetter(character) /*&& !('_'==character)*/) { return i - 1; }/*from w w w . j a v a2 s .c o m*/ } return string.length() - 1; } }