static bool endsWithLetterOrDigit(S s) { ret s != null && s.length() > 0 && Character.isLetterOrDigit(s.charAt(s.length()-1)); }