commons工具集——StringUtils
来源:互联网 发布:c语言函数的递归调用 编辑:程序博客网 时间:2024/04/29 20:03
StringUtils提供了以下的特性方法,所有的方法都是null安全和线程安全的:
- IsEmpty/IsBlank - checks if a String contains text
空白检测。empty指的是空字符串,即长度为0;blank指的是空白字符串,长度不一定为0,有可能包含空白符或制表符。
StringUtils.isEmpty(null) = true StringUtils.isEmpty("") = true StringUtils.isEmpty(" ") = false StringUtils.isEmpty("bob") = false StringUtils.isEmpty(" bob ") = false
StringUtils.isBlank(null) = true StringUtils.isBlank("") = true StringUtils.isBlank(" ") = true StringUtils.isBlank("bob") = false StringUtils.isBlank(" bob ") = false
- Trim/Strip - removes leading and trailing whitespace
- Equals - compares two strings null-safe
- startsWith - check if a String starts with a prefix null-safe
- endsWith - check if a String ends with a suffix null-safe
- IndexOf/LastIndexOf/Contains - null-safe index-of checks
- IndexOfAny/LastIndexOfAny/IndexOfAnyBut/LastIndexOfAnyBut - index-of any of a set of Strings
- ContainsOnly/ContainsNone/ContainsAny - does String contains only/none/any of these characters
- Substring/Left/Right/Mid - null-safe substring extractions
- SubstringBefore/SubstringAfter/SubstringBetween - substring extraction relative to other strings
- Split/Join - splits a String into an array of substrings and vice versa
- Remove/Delete - removes part of a String
- Replace/Overlay - Searches a String and replaces one String with another
- Chomp/Chop - removes the last part of a String
- LeftPad/RightPad/Center/Repeat - pads a String
- UpperCase/LowerCase/SwapCase/Capitalize/Uncapitalize - changes the case of a String
- CountMatches - counts the number of occurrences of one String in another
- IsAlpha/IsNumeric/IsWhitespace/IsAsciiPrintable - checks the characters in a String
- DefaultString - protects against a null input String
- Reverse/ReverseDelimited - reverses a String
- Abbreviate - abbreviates a string using ellipsis
- Difference - compares Strings and reports on their differences
- LevenshteinDistance - the number of changes needed to change one String into another
单词释义:
- null -
null
- empty - a zero-length string (
""
) - space - the space character (
' '
, char 32) - whitespace - the characters defined by
Character.isWhitespace(char)
- trim - the characters <= 32 as in
String.trim()
- commons工具集——StringUtils
- commons工具集——StringUtils
- Commons学习——StringUtils学习
- 工具类apache.commons.lang.StringUtils 使用心得
- 字符串工具类 org.apache.commons.lang.StringUtils
- org.apache.commons.lang3.StringUtils工具类常用方法
- 字符串工具类, 继承org.apache.commons.lang3.StringUtils类
- apache.commons.lang3.StringUtils工具类的使用
- org.apache.commons.lang.StringUtils(StringUtils工具类的常用方法)
- org.apache.commons.lang.StringUtils(StringUtils工具类的常用方法)
- org.apache.commons.lang.StringUtils(StringUtils工具类的常用方法)
- org.apache.commons.lang.StringUtils(StringUtils工具类的常用方法)
- org.apache.commons.lang.StringUtils(StringUtils工具类的常用方法)
- jasperreport和Struts2——java.lang.NoClassDefFoundError: org/apache/commons/lang/xwork/StringUtils
- apache commons StringUtils介绍
- apache commons StringUtils介绍
- apache commons StringUtils介绍
- Apache Commons StringUtils
- cmd访问被拒绝,因为您没有足够的特权
- 周迅独门独院的豪宅曝光(图)
- 工作经历
- 进程控制:waitpid()
- Catch that cow (H2717)
- commons工具集——StringUtils
- poj 3017 单调队列+dp+sbt
- oracle查看被锁的表和解锁
- 获取文件属性中详细信息里的各项目(vb 学习备注)
- 防火墙何时消失
- 五、注释符、运算符和通配符
- tomcat数据源的配置
- tiesanjiao
- ecb里使用自定义快捷键切换窗口