public final class CharacterUtil
extends java.lang.Object
char
. This class also provides a number of utility methods for working
with characters.
Character data is based upon the Unicode Standard, 4.0. The Unicode specification, character tables and other
information are available at http://www.unicode.org/.
Unicode characters are referred to as code points. The range of valid code points is U+0000 to U+10FFFF. The
Basic Multilingual Plane (BMP) is the code point range U+0000 to U+FFFF. Characters above the BMP are referred
to as Supplementary Characters. On the Java platform, UTF-16 encoding and char
pairs are used to
represent code points in the supplementary range. A pair of char
values that represent a supplementary
character are made up of a high surrogate with a value range of 0xD800 to 0xDBFF and a low surrogate
with a value range of 0xDC00 to 0xDFFF.
On the Java platform a char
value represents either a single BMP code point or a UTF-16 unit that's part of a
surrogate pair. The int
type is used to represent all Unicode code points.Constructor and Description |
---|
CharacterUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isSpaceChar(char c)
Indicates whether the specified character is a Unicode space character.
|
static char |
reverseBytes(char c)
Reverses the order of the first and second byte in the specified character.
|
static java.lang.String |
toString(char value)
Converts the specified character to its string representation.
|
public static boolean isSpaceChar(char c)
c
- the character to check.true
if c
is a Unicode space character, false
otherwise.public static char reverseBytes(char c)
c
- the character to reverse.public static java.lang.String toString(char value)
value
- the character to convert