public final class Strings extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
LINE_SEPARATOR
Line separator.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
contains(String string,
String[] strings)
Determines whether the specified strings contains the specified string.
|
static boolean |
containsIgnoreCase(String string,
String[] strings)
Determines whether the specified strings contains the specified string, ignoring case considerations.
|
static boolean |
isEmail(String string)
Checks whether the specified string is a valid email address.
|
static boolean |
isInteger(String string)
Checks whether the specified string is an integer.
|
static boolean |
isIPv4(String ip)
Is IPv4.
|
static boolean |
isNumeric(String string)
Checks whether the specified string is numeric.
|
static boolean |
isURL(String string)
Determines whether the specified string is a valid URL.
|
static List<String> |
toLines(String string)
Converts the specified string into a string list line by line.
|
static String[] |
trimAll(String[] strings)
Trims every string in the specified strings array.
|
public static final String LINE_SEPARATOR
public static boolean isIPv4(String ip)
ip - iptrue if it is, returns false otherwisepublic static List<String> toLines(String string) throws IOException
string - the specified stringnull if the specified
string is nullIOException - io exceptionpublic static boolean isNumeric(String string)
string - the specified stringtrue if the specified string is numeric, returns false otherwisepublic static boolean isInteger(String string)
string - the specified stringtrue if the specified string is an integer, returns false otherwisepublic static boolean isEmail(String string)
string - the specified stringtrue if the specified string is a valid email address,
returns false otherwisepublic static String[] trimAll(String[] strings)
strings - the specified strings array, returns null if the
specified strings is nullpublic static boolean containsIgnoreCase(String string, String[] strings)
string - the specified stringstrings - the specified stringstrue if the specified strings contains the specified string, ignoring case considerations, returns false
otherwisepublic static boolean contains(String string, String[] strings)
string - the specified stringstrings - the specified stringstrue if the specified strings contains the specified string, returns false otherwisepublic static boolean isURL(String string)
string - the specified stringtrue if the specified string is a valid URL, returns false otherwiseCopyright © 2009–2019 B3log. All rights reserved.