public final class StringUtil extends Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
in(String needle,
String... haystack) |
static boolean |
isBlank(String string)
Tests if a string is blank: null, emtpy, or only whitespace (" ", \r\n, \t, etc)
|
static boolean |
isNumeric(String string)
Tests if a string is numeric, i.e.
|
static boolean |
isWhitespace(int c)
Tests if a code point is "whitespace" as defined in the HTML spec.
|
static String |
join(Collection strings,
String sep)
Join a collection of strings by a seperator
|
static String |
join(Iterator strings,
String sep)
Join a collection of strings by a seperator
|
static String |
normaliseWhitespace(String string) |
static String |
padding(int width)
Returns space padding
|
public static String join(Collection strings, String sep)
strings
- collection of string objectssep
- string to place between stringspublic static String join(Iterator strings, String sep)
strings
- iterator of string objectssep
- string to place between stringspublic static String padding(int width)
width
- amount of padding desiredpublic static boolean isBlank(String string)
string
- string to testpublic static boolean isNumeric(String string)
string
- string to testpublic static boolean isWhitespace(int c)
c
- code point to testCopyright © 2009–2013 Jonathan Hedley. All rights reserved.