代码块 package com.test.boke; public class StringTest { public static void main(String[] args) { String str = "中国love you"; System.out.println(str.substring(str.length()-1)); } } 执行结果: u