7. public static String trimToEmpty(String str)
去掉字符串两端的控制符(control characters, char <= 32) ,如果变为 null 或 "" ,则返回 ""
下面是示例:
StringUtils.trimToEmpty(null) = ""
StringUtils.trimToEmpty("") = ""
StringUtils.trimToEmpty(" ") = ""
StringUtils.trimToEmpty(" \b \t \n \f \r ") = ""
StringUtils.trimToEmpty(" \n\tss \b") = "ss"
StringUtils.trimToEmpty(" d d dd ") = "d d dd"
StringUtils.trimToEmpty("dd ") = "dd"
StringUtils.trimToEmpty(" dd ") = "dd"
转自:http://janwer.iteye.com/blog/148313
去掉字符串两端的控制符(control characters, char <= 32) ,如果变为 null 或 "" ,则返回 ""
下面是示例:
StringUtils.trimToEmpty(null) = ""
StringUtils.trimToEmpty("") = ""
StringUtils.trimToEmpty(" ") = ""
StringUtils.trimToEmpty(" \b \t \n \f \r ") = ""
StringUtils.trimToEmpty(" \n\tss \b") = "ss"
StringUtils.trimToEmpty(" d d dd ") = "d d dd"
StringUtils.trimToEmpty("dd ") = "dd"
StringUtils.trimToEmpty(" dd ") = "dd"
转自:http://janwer.iteye.com/blog/148313