-
@Deprecated() public final class StringUtils
Implements utility functions to facilitate work with Strings.
-
-
Method Summary
Modifier and Type Method Description static booleanisNullOrEmpty(String s)Checks whether a string is {@code null}or blank (empty or whitespace).static booleanisNullOrEmpty(String s, boolean trim)Indicates whether string is null or empty. static InputStreamfromString(String string)Creates InputStream from the string in UTF8 encoding. static InputStreamfromString(String string, String encoding)Creates InputStream from the string in the specified encoding. static Array<byte>getUTF8Bytes(String string)Returns the UTF8 bytes for string and handles the unlikely casewhere UTF-8 is not supported. static StringgetUTF8String(Array<byte> bytes)Converts string into an UTF8 String and handles theunlikely case where UTF-8 is not supported. static booleancontainsLetters(String string)Indicates whether the given string contains any letters. static StringnewString(Array<byte> bytes)Initializes a new String instance by decoding a specified arrayof bytes (mostly used by JNI). -
-
Method Detail
-
isNullOrEmpty
static boolean isNullOrEmpty(String s)
Checks whether a string is
{@code null}or blank (empty or whitespace).- Parameters:
s- the string to analyze.
-
isNullOrEmpty
static boolean isNullOrEmpty(String s, boolean trim)
Indicates whether string is null or empty.
- Parameters:
s- the string to analyze.trim- indicates whether to trim the string.
-
fromString
static InputStream fromString(String string)
Creates InputStream from the string in UTF8 encoding.
- Parameters:
string- the string to convert.
-
fromString
static InputStream fromString(String string, String encoding)
Creates InputStream from the string in the specified encoding.
- Parameters:
string- the string to convert.encoding- the encoding
-
getUTF8Bytes
static Array<byte> getUTF8Bytes(String string)
Returns the UTF8 bytes for string and handles the unlikely casewhere UTF-8 is not supported.
- Parameters:
string- the String whose bytes we'd like to obtain.
-
getUTF8String
static String getUTF8String(Array<byte> bytes)
Converts string into an UTF8 String and handles theunlikely case where UTF-8 is not supported.
- Parameters:
bytes- the byte array that we'd like to convert into aString.
-
containsLetters
static boolean containsLetters(String string)
Indicates whether the given string contains any letters.
- Parameters:
string- the string to check for letters
-
-
-
-