|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.util.StringUtils
public final class StringUtils
String utilities class for utility functions not covered by third party libraries.
Method Summary | |
---|---|
static boolean |
containsCaseInsensitive(Collection<String> strings,
String string)
Returns true if the specified collection 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 String |
formatHttpDate(Date date)
Formats the specified date according to RFC 1123. |
static int |
indexOf(String s,
char searchChar,
int beginIndex,
int endIndex)
Returns the index within the specified 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 trimming the string before checking. |
static Date |
parseHttpDate(String s)
Parses the specified date string, assuming that it is formatted according to RFC 1123, RFC 1036 or as an ANSI C HTTP date header. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 escape
public static boolean containsWhitespace(String s)
s
- the string to check for whitespace
public static int indexOf(String s, char searchChar, int beginIndex, int endIndex)
s
- the string to searchsearchChar
- the character to search forbeginIndex
- the index at which to start the searchendIndex
- the index at which 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 checking
public static boolean containsCaseInsensitive(Collection<String> strings, String string)
strings
- the strings to searchstring
- the string to search for
public static Date parseHttpDate(String s)
s
- the string to parse as a date
public static String formatHttpDate(Date date)
date
- the date to format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |