isEmpty(String str) 是否爲空,空格字符爲false
System. out. println ( StringUtils. isEmpty ( " " ) ) ;
System. out. println ( StringUtils. isEmpty ( "" ) ) ;
System. out. println ( StringUtils. isEmpty ( "str" ) ) ;
System. out. println ( StringUtils. isEmpty ( null) ) ;
isNotEmpty(String str) 是否爲非空,空格字符爲true
System. out. println ( StringUtils. isNotEmpty ( " " ) ) ;
System. out. println ( StringUtils. isNotEmpty ( "" ) ) ;
System. out. println ( StringUtils. isNotEmpty ( "str" ) ) ;
System. out. println ( StringUtils. isNotEmpty ( null) ) ;
isBlank(String str) 是否爲空,空格字符爲true
System. out. println ( StringUtils. isBlank ( " " ) ) ;
System. out. println ( StringUtils. isBlank ( "" ) ) ;
System. out. println ( StringUtils. isBlank ( "str" ) ) ;
System. out. println ( StringUtils. isBlank ( null) ) ;
isNotBlank(String str) 是否爲非空,空格字符爲false
System. out. println ( StringUtils. isNotBlank ( " " ) ) ;
System. out. println ( StringUtils. isNotBlank ( "" ) ) ;
System. out. println ( StringUtils. isNotBlank ( "str" ) ) ;
System. out. println ( StringUtils. isNotBlank ( null) ) ;
trim(String str)去除字符串兩端的控制符,空字符串、null 返回 null
System. out. println ( StringUtils. trim ( " ss " ) ) ;
System. out. println ( StringUtils. trim ( " s s " ) ) ;
System. out. println ( StringUtils. trim ( null) ) ;
trimToEmpty(String str) 去除字符串兩端的控制符,空字符串、null 返回""
System. out. println ( StringUtils. trimToEmpty ( " ss " ) ) ;
System. out. println ( StringUtils. trimToEmpty ( " s s " ) ) ;
System. out. println ( StringUtils. trimToEmpty ( null) ) ;
strip(String str, String stripChars) 去掉str兩端的在stripChars中的字符
System. out. println ( StringUtils. strip ( "ssab" , "sasss" ) ) ;
stripStart (String str,String stripChars) 去除str 前端在stripChars中的字符
System. out. println ( StringUtils. stripStart ( "ssab" , "sasss" ) ) ;
stripEnd (String str,String stripChars) 去除str 後端在stripChars中的字符
System. out. println ( StringUtils. stripEnd ( "ssaba" , "sasss" ) ) ;
equals(String str1,String str2) 比較兩個字符串是否相等,如果兩個均爲空則認爲相等
System. out. println ( StringUtils. equals ( "" , null) ) ;
System. out. println ( StringUtils. equals ( "" , "" ) ) ;
swapCase(String str) 字符串中的大寫轉小寫,小寫轉換爲大寫
System. out. println ( StringUtils. swapCase ( "aaAAaa" ) ) ;
repeat(String str,int repart) 重複字符串repeat次
System. out. println ( StringUtils. repeat ( "aaAAaa" , 3 ) ) ;
chop(String str) 去掉字符串的最後一個字符,比如/r/n
System. out. println ( StringUtils. chop ( "aaAAaa" ) ) ;