Package com.alibaba.druid.util
Class StringUtils
java.lang.Object
com.alibaba.druid.util.StringUtils
- Author:
- sandzhang[sandzhangtoo@gmail.com]
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanequalsIgnoreCase(String a, String b) static StringformatDateTime19(long millis, TimeZone timeZone) static booleanisEmpty(CharSequence value) static booleanisNumber(char[] chars) static booleanstatic intlowerHashCode(String text) static Stringstatic StringreplaceAll(String s, String src, String dest) static IntegerConverts a string representation of an integer to an Integer object.static StringExample: subString("abcd","a","c")="b"static StringExample: subString("abcdc","a","c",true)="bcd"static IntegersubStringToInteger(String src, String start, String to) Example: subString("12345","1","4")=23
-
Method Details
-
subStringToInteger
Example: subString("12345","1","4")=23- Parameters:
src- the source string from which to extract the substringstart- the starting point of the substringto- the ending point of the substring- Returns:
- the extracted substring converted to an Integer, or null if any of the input strings is null
-
subString
Example: subString("abcd","a","c")="b"- Parameters:
src- the source string from which to extract the substringstart- null while start from index=0to- null while to index=src.length- Returns:
- the extracted substring, or null if any of the input strings is null
-
subString
Example: subString("abcdc","a","c",true)="bcd"- Parameters:
src- the source string from which to extract the substringstart- null while start from index=0to- null while to index=src.lengthtoLast- true while to index=src.lastIndexOf(to)- Returns:
- the extracted substring, or null if any of the input strings is null, or if the start/end points are invalid
-
stringToInteger
Converts a string representation of an integer to an Integer object.- Parameters:
in- the input string to be converted (can be null)- Returns:
- the Integer object parsed from the input string, or null if the input is null, empty, or not a valid integer
-
equals
-
equalsIgnoreCase
-
isEmpty
-
lowerHashCode
-
isNumber
-
isNumber
public static boolean isNumber(char[] chars) -
formatDateTime19
-
removeNameQuotes
-
replaceAll
-