第一种:

String str = "daipogfhjoripa1";
char c = str.charAt(str.length() - 1);

第二种:

str.substring(str.length()-1);

更多推荐

java获取字符串最后一个字符