1.获取字符串的最后一位或第一位 str.charAt(str.length - 1); str.charAt(0); 转载于:https://www.cnblogs.com/wxm-bk/p/5942154.html