public final class Strings
extends java.lang.Object
Utility class for Strings.
Modifier and Type | Method and Description |
---|---|
static int |
compareUnsignedBytes(java.lang.String s1,
java.lang.String s2,
java.nio.charset.Charset charset)
Compares two string by comparing their byte arrays.
|
static boolean |
isNullOrEmpty(java.lang.String str) |
static java.lang.String |
toDash(java.lang.String str)
Converts a string from camel case to a string with dashes.
|
static java.lang.String |
toUnderscore(java.lang.String str)
Converts a string from camel case to a string with underscores.
|
public static boolean isNullOrEmpty(java.lang.String str)
public static java.lang.String toDash(java.lang.String str)
Converts a string from camel case to a string with dashes.
Each upper case character (except the first one) followed by a lower case character is converted to a lower case character preceded by a dash.
E.g. “CamelCase” is converted to “camel-case”.
str
- The string.public static java.lang.String toUnderscore(java.lang.String str)
Converts a string from camel case to a string with underscores.
Each upper case character (except the first one) followed by a lower case character is converted to a lower case character preceded by an underscore.
E.g. “CamelCase” is converted to “camel_case”.
str
- The string.public static int compareUnsignedBytes(java.lang.String s1, java.lang.String s2, java.nio.charset.Charset charset)
Compares two string by comparing their byte arrays. The “i;octet” collation is described in 9.3.1. Octet Collation Description.
s1
- The first byte array.s2
- The second byte array.charset
- The charset.Copyright © 2014–2019 XMPP.rocks. All rights reserved.