public class StringUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
COMMA_SEPARATOR |
static Charset |
UTF8 |
| 构造器和说明 |
|---|
StringUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
fromBigDecimal(BigDecimal value) |
static String |
fromBigInteger(BigInteger value) |
static String |
fromBoolean(Boolean value) |
static String |
fromByte(Byte b)
Returns the string representation of the specified Byte.
|
static String |
fromDate(Date value)
Converts the specified date to an ISO 8601 timestamp string and returns
it.
|
static String |
fromDouble(Double d)
Returns the string representation of the specified double.
|
static String |
fromFloat(Float value) |
static String |
fromInteger(Integer value) |
static String |
fromLong(Long value) |
static String |
fromString(String value) |
static boolean |
isNullOrEmpty(String value) |
static String |
join(List<String> strings)
Returns a new string created by joining each of the strings in the
specified list together, with a comma between them.
|
static String |
join(String joiner,
String... parts)
Joins the strings in parts with joiner between each string
|
static String |
removeQuotes(String s)
Removes any surrounding quotes from the specified string and returns a
new string.
|
static String |
replace(String originalString,
String partToMatch,
String replacement) |
static BigDecimal |
toBigDecimal(String s) |
static BigInteger |
toBigInteger(String s) |
static Boolean |
toBoolean(StringBuilder value) |
static Integer |
toInteger(StringBuilder value) |
static String |
toString(StringBuilder value) |
static String |
trim(String value)
A null-safe trim method.
|
public static final Charset UTF8
public static Integer toInteger(StringBuilder value)
public static String toString(StringBuilder value)
public static Boolean toBoolean(StringBuilder value)
public static String fromBigInteger(BigInteger value)
public static String fromBigDecimal(BigDecimal value)
public static BigInteger toBigInteger(String s)
public static BigDecimal toBigDecimal(String s)
public static String fromDate(Date value)
value - The date to format as an ISO 8601 timestamp string.public static String fromDouble(Double d)
d - The double to represent as a string.public static String fromByte(Byte b)
b - The Byte to represent as a string.public static String join(String joiner, String... parts)
joiner - the string to insert between the strings in partsparts - the parts to joinpublic static String trim(String value)
public static boolean isNullOrEmpty(String value)
public static String removeQuotes(String s)
s - The string to check for surrounding quotes.public static String join(List<String> strings)
strings - The list of strings to join into a single, comma delimited
string list.Copyright © 2017. All rights reserved.