public final class StringUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
concatenateWords(java.lang.String string)
Removes all spaces from the given string and returns a concatenated
result string.
|
static boolean |
containsLetters(java.lang.String string)
Indicates whether the given string contains any letters.
|
static java.lang.String |
convertCamelCaseToDisplayString(java.lang.String camelCase)
Gets a String which represents the conversion of a specific
camel-case formatted String to a more human-readable form (i.e.
|
static java.io.InputStream |
fromString(java.lang.String string)
Creates InputStream from the string in UTF8 encoding.
|
static java.io.InputStream |
fromString(java.lang.String string,
java.lang.String encoding)
Creates InputStream from the string in the specified encoding.
|
static byte[] |
getUTF8Bytes(java.lang.String string)
Returns the UTF8 bytes for string and handles the unlikely case
where UTF-8 is not supported.
|
static java.lang.String |
getUTF8String(byte[] bytes)
Converts string into an UTF8 String and handles the
unlikely case where UTF-8 is not supported.
|
static boolean |
isEquals(java.lang.String s1,
java.lang.String s2)
Determines whether a specific String value equals another
String value.
|
static boolean |
isNullOrEmpty(java.lang.String s)
Indicates whether string is null or empty.
|
static boolean |
isNullOrEmpty(java.lang.String s,
boolean trim)
Indicates whether string is null or empty.
|
static boolean |
isNumber(java.lang.String string)
Indicates if the given string is composed only of digits or not.
|
static java.lang.String |
newString(byte[] bytes)
Initializes a new String instance by decoding a specified array
of bytes (mostly used by JNI).
|
public static java.lang.String convertCamelCaseToDisplayString(java.lang.String camelCase)
camelCase
- a camel-case (or Pascal-case) formatted String
from which a human-readable String is to be constructedpublic static boolean isNullOrEmpty(java.lang.String s)
s
- the string to analyze.public static boolean isNullOrEmpty(java.lang.String s, boolean trim)
s
- the string to analyze.trim
- indicates whether to trim the string.public static boolean isEquals(java.lang.String s1, java.lang.String s2)
s1
- the first String value to check for value equality
with the seconds2
- the second String value to check for value equality
with the firstpublic static java.io.InputStream fromString(java.lang.String string) throws java.io.UnsupportedEncodingException
string
- the string to convert.java.io.UnsupportedEncodingException
- if UTF8 is unsupported.public static java.io.InputStream fromString(java.lang.String string, java.lang.String encoding) throws java.io.UnsupportedEncodingException
string
- the string to convert.encoding
- the encodingjava.io.UnsupportedEncodingException
- if the encoding is unsupported.public static byte[] getUTF8Bytes(java.lang.String string)
string
- the String whose bytes we'd like to obtain.public static java.lang.String getUTF8String(byte[] bytes)
bytes
- the byte array that we'd like to convert into a
String.public static boolean isNumber(java.lang.String string)
string
- the string to checkpublic static boolean containsLetters(java.lang.String string)
string
- the string to check for letterspublic static java.lang.String concatenateWords(java.lang.String string)
string
- the string to concatenatepublic static java.lang.String newString(byte[] bytes)
bytes
- the bytes to be decoded into characters/a new
String instance
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.