trim() 去掉字符串的头和尾。
eg:
String a = " Hi Java ";
String b= "Hi Java";
System.out.println(b.equals(a));
a = a.trim();
System.out.println(b.equals(a));
trim前返回false,
trim后返回true
trim() 去掉字符串的头和尾。
eg:
String a = " Hi Java ";
String b= "Hi Java";
System.out.println(b.equals(a));
a = a.trim();
System.out.println(b.equals(a));
trim前返回false,
trim后返回true