public final class StringUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsCaseInsensitive(List<String> strings,
String string)
Returns true if the specified list of strings contains the specified string, ignoring case.
|
static boolean |
containsWhitespace(String s)
Returns true if the specified string contains whitespace, false otherwise.
|
static String |
escapeXmlChars(String s)
Escapes the characters '<', '>' and '&' into their XML entity equivalents.
|
static int |
indexOf(String s,
char searchChar,
int beginIndex,
int endIndex)
Returns the index within a given string of the first occurrence of
the specified search character.
|
static boolean |
isFloat(String s,
boolean trim)
Returns true if the specified string is a valid float, possibly triming the string before checking.
|
public static String escapeXmlChars(String s)
StringEscapeUtils.escapeXml(String) or
StringEscapeUtils.escapeHtml(String) because those methods
escape some unicode characters as well.s - the string to escapepublic static boolean containsWhitespace(String s)
s - the string to check for whitespacepublic static int indexOf(String s, char searchChar, int beginIndex, int endIndex)
s - a string.searchChar - a search character.beginIndex - the index to start the search from.endIndex - the index to stop the search.public static boolean isFloat(String s, boolean trim)
s - the string to checktrim - whether or not to trim the string before checkingpublic static boolean containsCaseInsensitive(List<String> strings, String string)
strings - the strings to searchstring - the string to search forCopyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.