public class StringUtils extends Object
| 构造器和说明 |
|---|
StringUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
areAllCharsInRange(String value,
char start,
char end) |
static String |
convertStringToCharEntities(String str)
Convert a string to a set of character entities.
|
static String |
getTextAsFormattedLines(String text,
int lineLength)
Given a chunk of text format it so that you return a new String
with the line length equal to that passed in.
|
static boolean |
hasCharInRange(String value,
char start,
char end)
Indicate whether the String value has at least one
character in the range specified.
|
static boolean |
hasValue(String v) |
static String |
removeChar(String str,
char c)
Given a particular String, remove any instances of the given
character from it and return a new String.
|
static String |
replaceAllStrings(String text,
Map map) |
static String |
replaceAllStrings(String text,
Map map,
boolean caseSensitive) |
static String |
replaceString(String text,
String str,
String replace) |
static String |
replaceString(String text,
String str,
String replace,
boolean caseSensitive) |
static List |
tokenizeString(String str,
String token)
A method to chop up a String on another multi-character String and
then return the results in a List.
|
public static String convertStringToCharEntities(String str)
str - The string to convert.public static String getTextAsFormattedLines(String text, int lineLength)
text - The text to format.lineLength - The line length to format the text to.public static boolean hasCharInRange(String value, char start, char end)
value - The value to check.start - The starting character of the range.end - The end character of the range.true if it has at least
one character in the range, false
otherwise.public static List tokenizeString(String str, String token)
str - The String to chop up.token - The token to look for. This should be just a plain
String, this method doesn't support regular expressions.public static boolean hasValue(String v)
public static String replaceAllStrings(String text, Map map, boolean caseSensitive)
public static String replaceString(String text, String str, String replace, boolean caseSensitive) throws NullPointerException
public static String replaceString(String text, String str, String replace) throws NullPointerException
public static boolean areAllCharsInRange(String value, char start, char end)
Copyright © 2021. All rights reserved.