Java11新特性——String新增方法 String新增方法 String判空方法 去除首尾部分空白 复制字符串 isEmpty()和isBlank对比 isEmpty源码 isBlank源码(当前为非中文源码跟踪) 解读 String新增方法 String判空方法 //String判空方法isBlank() System.out.println(" ".isBlank()); 去除首尾部分空白 //去除首尾部分空白strip() System.out.println(" hello ".strip()); 复制字符串 //使用repeat(int time)方法,参数表示复制次数 System.out.println("hello".repeat(10)