String s = " hfjs df ";
s.trim(); //去除首尾空格
System.out.println(s); //输出结果"hfjs df"
java:String的trim()方法,去除字符串首尾空格
最新推荐文章于 2022-11-26 15:54:48 发布
String s = " hfjs df ";
s.trim(); //去除首尾空格
System.out.println(s); //输出结果"hfjs df"