java开发_org.apache.commons.lang.StringUtils工具类源码
发布时间:2020-12-14 06:28:16 所属栏目:Java 来源:网络整理
导读:在之前写了一篇关于""和null区别的文章。 下面是文章的地址: 下面看看org.apache.commons.lang.StringUtils工具类源码 Operations on { null safe. IsEmpty/IsBlank Trim/Strip Equals startsWith endsWith IndexOf/LastIndexOf/Contains IndexOfAny/LastIn
在之前写了一篇关于""和null区别的文章。 下面是文章的地址: 下面看看org.apache.commons.lang.StringUtils工具类源码
Operations on { null safe.
IsEmpty/IsBlank
Trim/Strip
Equals
startsWith
endsWith
IndexOf/LastIndexOf/Contains
IndexOfAny/LastIndexOfAny/IndexOfAnyBut/LastIndexOfAnyBut
ContainsOnly/ContainsNone/ContainsAny
Substring/Left/Right/Mid
SubstringBefore/SubstringAfter/SubstringBetween
Split/Join
Remove/Delete
Replace/Overlay
Chomp/Chop
LeftPad/RightPad/Center/Repeat
UpperCase/LowerCase/SwapCase/Capitalize/Uncapitalize
CountMatches
IsAlpha/IsNumeric/IsWhitespace/IsAsciiPrintable
DefaultString
Reverse/ReverseDelimited
Abbreviate
Difference
LevensteinDistance
The StringUtils class defines certain words related to
null - null
empty - a zero-length string ("" )
space - the space character (' ' ,char 32)
whitespace - the characters defined by {
trim - the characters <= 32 as in {
StringUtils handles null input Strings quietly.
null input will return null .
boolean or int is being returned
A side effect of the null handling is that a
NullPointerException should be considered a bug in
StringUtils (except for deprecated methods).
Methods in this class give sample code to explain their operation.
* is used to indicate any input including null .
#ThreadSafe#
|