Top Description Inners Fields Constructors Methods
java.lang

public final Class Character

extends Object
implements Serializable, Comparable<Character>, Constable
Class Inheritance
All Implemented Interfaces
java.lang.constant.Constable, java.lang.Comparable, java.io.Serializable
Annotations
@ValueBased
Imports
jdk.internal.misc.CDS, jdk.internal.vm.annotation.IntrinsicCandidate, .Stable, java.lang.constant.Constable, .DynamicConstantDesc, java.util.Arrays, .HashMap, .Locale, .Map, .Objects, .Optional

The Character class wraps a value of the primitive type char in an object. An object of class Character contains a single field whose type is char.

In addition, this class provides a large number of static methods for determining a character's category (lowercase letter, digit, etc.) and for converting characters from uppercase to lowercase and vice versa.

Unicode Conformance

The fields and methods of class Character are defined in terms of character information from the Unicode Standard, specifically the UnicodeData file that is part of the Unicode Character Database. This file specifies properties including name and category for every assigned Unicode code point or character range. The file is available from the Unicode Consortium at http://www.unicode.org.

Character information is based on the Unicode Standard, version 15.1.

The Java platform has supported different versions of the Unicode Standard over time. Upgrades to newer versions of the Unicode Standard occurred in the following Java releases, each indicating the new version:

Shows Java releases and supported Unicode versions
Java release Unicode version
Java SE 22 Unicode 15.1
Java SE 20 Unicode 15.0
Java SE 19 Unicode 14.0
Java SE 15 Unicode 13.0
Java SE 13 Unicode 12.1
Java SE 12 Unicode 11.0
Java SE 11 Unicode 10.0
Java SE 9 Unicode 8.0
Java SE 8 Unicode 6.2
Java SE 7 Unicode 6.0
Java SE 5.0 Unicode 4.0
Java SE 1.4 Unicode 3.0
JDK 1.1 Unicode 2.0
JDK 1.0.2 Unicode 1.1.5
Variations from these base Unicode versions, such as recognized appendixes, are documented elsewhere.

Unicode Character Representations

The char data type (and therefore the value that a Character object encapsulates) are based on the original Unicode specification, which defined characters as fixed-width 16-bit entities. The Unicode Standard has since been changed to allow for characters whose representation requires more than 16 bits. The range of legal code points is now U+0000 to U+10FFFF, known as Unicode scalar value. (Refer to the definition of the U+n notation in the Unicode Standard.)

The set of characters from U+0000 to U+FFFF is sometimes referred to as the Basic Multilingual Plane (BMP). Characters whose code points are greater than U+FFFF are called supplementary characters. The Java platform uses the UTF-16 representation in char arrays and in the String and StringBuffer classes. In this representation, supplementary characters are represented as a pair of char values, the first from the high-surrogates range, (\uD800-\uDBFF), the second from the low-surrogates range (\uDC00-\uDFFF).

A char value, therefore, represents Basic Multilingual Plane (BMP) code points, including the surrogate code points, or code units of the UTF-16 encoding. An int value represents all Unicode code points, including supplementary code points. The lower (least significant) 21 bits of int are used to represent Unicode code points and the upper (most significant) 11 bits must be zero. Unless otherwise specified, the behavior with respect to supplementary characters and surrogate char values is as follows:

In the Java SE API documentation, Unicode code point is used for character values in the range between U+0000 and U+10FFFF, and Unicode code unit is used for 16-bit char values that are code units of the UTF-16 encoding. For more information on Unicode terminology, refer to the Unicode Glossary.

This is a value-based class; programmers should treat instances that are equal as interchangeable and should not use instances for synchronization, or unpredictable behavior may occur. For example, in a future release, synchronization may fail.

Authors
Lee Boynton, Guy Steele, Akira Tanaka, Martin Buchholz, Ulf Zibis
Since
1.0
External Specification
https://www.unicode.org/reports/tr27

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static class
Character.Subset

Instances of this class represent particular subsets of the Unicode character set.

public static class
Character.UnicodeBlock

A family of character subsets representing the character blocks in the Unicode specification.

public static enum
Character.UnicodeScript

A family of character subsets representing the character scripts defined in the Unicode Standard Annex #24: Script Names.

Field Summary

Modifier and TypeField and Description
public static final int
BYTES

The number of bytes used to represent a char value in unsigned binary form.

public static final byte
COMBINING_SPACING_MARK

General category "Mc" in the Unicode specification.

public static final byte
CONNECTOR_PUNCTUATION

General category "Pc" in the Unicode specification.

public static final byte
CONTROL

General category "Cc" in the Unicode specification.

public static final byte
CURRENCY_SYMBOL

General category "Sc" in the Unicode specification.

public static final byte
DASH_PUNCTUATION

General category "Pd" in the Unicode specification.

public static final byte
DECIMAL_DIGIT_NUMBER

General category "Nd" in the Unicode specification.

public static final byte
DIRECTIONALITY_ARABIC_NUMBER

Weak bidirectional character type "AN" in the Unicode specification.

public static final byte
DIRECTIONALITY_BOUNDARY_NEUTRAL

Weak bidirectional character type "BN" in the Unicode specification.

public static final byte
DIRECTIONALITY_COMMON_NUMBER_SEPARATOR

Weak bidirectional character type "CS" in the Unicode specification.

public static final byte
DIRECTIONALITY_EUROPEAN_NUMBER

Weak bidirectional character type "EN" in the Unicode specification.

public static final byte
DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR

Weak bidirectional character type "ES" in the Unicode specification.

public static final byte
DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR

Weak bidirectional character type "ET" in the Unicode specification.

public static final byte
DIRECTIONALITY_FIRST_STRONG_ISOLATE

Weak bidirectional character type "FSI" in the Unicode specification.

public static final byte
DIRECTIONALITY_LEFT_TO_RIGHT

Strong bidirectional character type "L" in the Unicode specification.

public static final byte
DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING

Strong bidirectional character type "LRE" in the Unicode specification.

public static final byte
DIRECTIONALITY_LEFT_TO_RIGHT_ISOLATE

Weak bidirectional character type "LRI" in the Unicode specification.

public static final byte
DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE

Strong bidirectional character type "LRO" in the Unicode specification.

public static final byte
DIRECTIONALITY_NONSPACING_MARK

Weak bidirectional character type "NSM" in the Unicode specification.

public static final byte
DIRECTIONALITY_OTHER_NEUTRALS

Neutral bidirectional character type "ON" in the Unicode specification.

public static final byte
DIRECTIONALITY_PARAGRAPH_SEPARATOR

Neutral bidirectional character type "B" in the Unicode specification.

public static final byte
DIRECTIONALITY_POP_DIRECTIONAL_FORMAT

Weak bidirectional character type "PDF" in the Unicode specification.

public static final byte
DIRECTIONALITY_POP_DIRECTIONAL_ISOLATE

Weak bidirectional character type "PDI" in the Unicode specification.

public static final byte
DIRECTIONALITY_RIGHT_TO_LEFT

Strong bidirectional character type "R" in the Unicode specification.

public static final byte
DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC

Strong bidirectional character type "AL" in the Unicode specification.

public static final byte
DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING

Strong bidirectional character type "RLE" in the Unicode specification.

public static final byte
DIRECTIONALITY_RIGHT_TO_LEFT_ISOLATE

Weak bidirectional character type "RLI" in the Unicode specification.

public static final byte
DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE

Strong bidirectional character type "RLO" in the Unicode specification.

public static final byte
DIRECTIONALITY_SEGMENT_SEPARATOR

Neutral bidirectional character type "S" in the Unicode specification.

public static final byte
DIRECTIONALITY_UNDEFINED

Undefined bidirectional character type.

public static final byte
DIRECTIONALITY_WHITESPACE

Neutral bidirectional character type "WS" in the Unicode specification.

public static final byte
ENCLOSING_MARK

General category "Me" in the Unicode specification.

public static final byte
END_PUNCTUATION

General category "Pe" in the Unicode specification.

pack-priv static final int
ERROR

Error flag.

public static final byte
FINAL_QUOTE_PUNCTUATION

General category "Pf" in the Unicode specification.

public static final byte
FORMAT

General category "Cf" in the Unicode specification.

public static final byte
INITIAL_QUOTE_PUNCTUATION

General category "Pi" in the Unicode specification.

public static final byte
LETTER_NUMBER

General category "Nl" in the Unicode specification.

public static final byte
LINE_SEPARATOR

General category "Zl" in the Unicode specification.

public static final byte
LOWERCASE_LETTER

General category "Ll" in the Unicode specification.

public static final byte
MATH_SYMBOL

General category "Sm" in the Unicode specification.

public static final int
MAX_CODE_POINT

The maximum value of a Unicode code point, constant U+10FFFF.

public static final char
MAX_HIGH_SURROGATE

The maximum value of a Unicode high-surrogate code unit in the UTF-16 encoding, constant '\uDBFF'.

public static final char
MAX_LOW_SURROGATE

The maximum value of a Unicode low-surrogate code unit in the UTF-16 encoding, constant '\uDFFF'.

public static final int
MAX_RADIX

The maximum radix available for conversion to and from strings.

public static final char
MAX_SURROGATE

The maximum value of a Unicode surrogate code unit in the UTF-16 encoding, constant '\uDFFF'.

public static final char
MAX_VALUE

The constant value of this field is the largest value of type char, '\uFFFF'.

public static final int
MIN_CODE_POINT

The minimum value of a Unicode code point, constant U+0000.

public static final char
MIN_HIGH_SURROGATE

The minimum value of a Unicode high-surrogate code unit in the UTF-16 encoding, constant '\uD800'.

public static final char
MIN_LOW_SURROGATE

The minimum value of a Unicode low-surrogate code unit in the UTF-16 encoding, constant '\uDC00'.

public static final int
MIN_RADIX

The minimum radix available for conversion to and from strings.

public static final int
MIN_SUPPLEMENTARY_CODE_POINT

The minimum value of a Unicode supplementary code point, constant U+10000.

public static final char
MIN_SURROGATE

The minimum value of a Unicode surrogate code unit in the UTF-16 encoding, constant '\uD800'.

public static final char
MIN_VALUE

The constant value of this field is the smallest value of type char, '\u0000'.

public static final byte
MODIFIER_LETTER

General category "Lm" in the Unicode specification.

public static final byte
MODIFIER_SYMBOL

General category "Sk" in the Unicode specification.

public static final byte
NON_SPACING_MARK

General category "Mn" in the Unicode specification.

public static final byte
OTHER_LETTER

General category "Lo" in the Unicode specification.

public static final byte
OTHER_NUMBER

General category "No" in the Unicode specification.

public static final byte
OTHER_PUNCTUATION

General category "Po" in the Unicode specification.

public static final byte
OTHER_SYMBOL

General category "So" in the Unicode specification.

public static final byte
PARAGRAPH_SEPARATOR

General category "Zp" in the Unicode specification.

public static final byte
PRIVATE_USE

General category "Co" in the Unicode specification.

private static final long
serialVersionUID

use serialVersionUID from JDK 1.0.2 for interoperability

public static final int
SIZE

The number of bits used to represent a char value in unsigned binary form, constant 16.

public static final byte
SPACE_SEPARATOR

General category "Zs" in the Unicode specification.

public static final byte
START_PUNCTUATION

General category "Ps" in the Unicode specification.

public static final byte
SURROGATE

General category "Cs" in the Unicode specification.

public static final byte
TITLECASE_LETTER

General category "Lt" in the Unicode specification.

public static final Class<Character>
TYPE

The Class instance representing the primitive type char.

public static final byte
UNASSIGNED

General category "Cn" in the Unicode specification.

public static final byte
UPPERCASE_LETTER

General category "Lu" in the Unicode specification.

private final char
value

The value of the Character.

Constructor Summary

AccessConstructor and Description
public
Character(char
the value to be represented by the Character object.
value
)
Deprecated for removal since 9. It is rarely appropriate to use this constructor.

Constructs a newly allocated Character object that represents the specified char value.

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

2 if the character is a valid supplementary character; 1 otherwise.
charCount
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines the number of char values needed to represent the specified character (Unicode code point).

public char

Returns:

the primitive char value represented by this object.
charValue
()

Returns the value of this Character object.

public static int

Returns:

the Unicode code point at the given index
codePointAt
(CharSequence
a sequence of char values (Unicode code units)
seq
,
int
the index to the char values (Unicode code units) in seq to be converted
index
)

Returns the code point at the given index of the CharSequence.

public static int

Returns:

the Unicode code point at the given index
codePointAt
(char[]
the char array
a
,
int
the index to the char values (Unicode code units) in the char array to be converted
index
)

Returns the code point at the given index of the char array.

public static int

Returns:

the Unicode code point at the given index
codePointAt
(char[]
the char array
a
,
int
the index to the char values (Unicode code units) in the char array to be converted
index
,
int
the index after the last array element that can be used in the char array
limit
)

Returns the code point at the given index of the char array, where only array elements with index less than limit can be used.

pack-priv static int
codePointAtImpl(char[] a, int index, int limit)

public static int

Returns:

the Unicode code point value before the given index.
codePointBefore
(CharSequence
the CharSequence instance
seq
,
int
the index following the code point that should be returned
index
)

Returns the code point preceding the given index of the CharSequence.

public static int

Returns:

the Unicode code point value before the given index.
codePointBefore
(char[]
the char array
a
,
int
the index following the code point that should be returned
index
)

Returns the code point preceding the given index of the char array.

public static int

Returns:

the Unicode code point value before the given index.
codePointBefore
(char[]
the char array
a
,
int
the index following the code point that should be returned
index
,
int
the index of the first array element in the char array
start
)

Returns the code point preceding the given index of the char array, where only array elements with index greater than or equal to start can be used.

pack-priv static int
codePointBeforeImpl(char[] a, int index, int start)

public static int

Returns:

the number of Unicode code points in the specified text range
codePointCount
(CharSequence
the char sequence
seq
,
int
the index to the first char of the text range.
beginIndex
,
int
the index after the last char of the text range.
endIndex
)

Returns the number of Unicode code points in the text range of the specified char sequence.

public static int

Returns:

the number of Unicode code points in the specified subarray
codePointCount
(char[]
the char array
a
,
int
the index of the first char in the given char array
offset
,
int
the length of the subarray in chars
count
)

Returns the number of Unicode code points in a subarray of the char array argument.

pack-priv static int
codePointCountImpl(char[] a, int offset, int count)

public static int

Returns:

the code point value of the character specified by its name.
codePointOf
(String
the character name
name
)

Returns the code point value of the Unicode character specified by the given character name.

public static int

Returns:

the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y
compare
(char
the first char to compare
x
,
char
the second char to compare
y
)

Compares two char values numerically.

public int

Returns:

the value 0 if the argument Character is equal to this Character; a value less than 0 if this Character is numerically less than the Character argument; and a value greater than 0 if this Character is numerically greater than the Character argument (unsigned comparison). Note that this is strictly a numerical comparison; it is not locale-dependent.
compareTo
(Character
the Character to be compared.
anotherCharacter
)

Implements java.lang.Comparable.compareTo.

Compares two Character objects numerically.

public Optional<DynamicConstantDesc<Character>>

Returns:

an Optional describing the Character instance
describeConstable
()

Implements java.lang.constant.Constable.describeConstable.

Returns an Optional containing the nominal descriptor for this instance.

public static int

Returns:

the numeric value represented by the character in the specified radix.
digit
(char
the character to be converted.
ch
,
int
the radix.
radix
)

Returns the numeric value of the character ch in the specified radix.

public static int

Returns:

the numeric value represented by the character in the specified radix.
digit
(int
the character (Unicode code point) to be converted.
codePoint
,
int
the radix.
radix
)

Returns the numeric value of the specified character (Unicode code point) in the specified radix.

public boolean

Returns:

true if the objects are the same; false otherwise.
equals
(Object
the object to compare with.
obj
)

Overrides java.lang.Object.equals.

Compares this object against the specified object.

public static char

Returns:

the char representation of the specified digit in the specified radix.
forDigit
(int
the number to convert to a character.
digit
,
int
the radix.
radix
)

Determines the character representation for a specific digit in the specified radix.

public static byte

Returns:

the directionality property of the char value.
getDirectionality
(char
char for which the directionality property is requested.
ch
)

Returns the Unicode directionality property for the given character.

public static byte

Returns:

the directionality property of the character.
getDirectionality
(int
the character (Unicode code point) for which the directionality property is requested.
codePoint
)

Returns the Unicode directionality property for the given character (Unicode code point).

public static String

Returns:

the name of the specified character, or null if the code point is unassigned.
getName
(int
the character (Unicode code point)
codePoint
)

Returns the name of the specified character codePoint, or null if the code point is unassigned.

public static int

Returns:

the numeric value of the character, as a nonnegative int value; -2 if the character has a numeric value but the value can not be represented as a nonnegative int value; -1 if the character has no numeric value.
getNumericValue
(char
the character to be converted.
ch
)

Returns the int value that the specified Unicode character represents.

public static int

Returns:

the numeric value of the character, as a nonnegative int value; -2 if the character has a numeric value but the value can not be represented as a nonnegative int value; -1 if the character has no numeric value.
getNumericValue
(int
the character (Unicode code point) to be converted.
codePoint
)

Returns the int value that the specified character (Unicode code point) represents.

public static int

Returns:

a value of type int representing the character's general category.
getType
(char
the character to be tested.
ch
)

Returns a value indicating a character's general category.

public static int

Returns:

a value of type int representing the character's general category.
getType
(int
the character (Unicode code point) to be tested.
codePoint
)

Returns a value indicating a character's general category.

public int

Returns:

a hash code value for this Character
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code for this Character; equal to the result of invoking charValue().

public static int

Returns:

a hash code value for a char value.
hashCode
(char
The char for which to return a hash code.
value
)

Returns a hash code for a char value; compatible with Character.hashCode().

public static char

Returns:

the leading surrogate code unit used to represent the character in the UTF-16 encoding
highSurrogate
(int
a supplementary character (Unicode code point)
codePoint
)

Returns the leading surrogate (a high surrogate code unit) of the surrogate pair representing the specified supplementary character (Unicode code point) in the UTF-16 encoding.

public static boolean

Returns:

true if the character is a Unicode alphabet character, false otherwise.
isAlphabetic
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is alphabetic.

public static boolean

Returns:

true if the specified code point is between MIN_VALUE and MAX_VALUE inclusive; false otherwise.
isBmpCodePoint
(int
the character (Unicode code point) to be tested
codePoint
)

Determines whether the specified character (Unicode code point) is in the Basic Multilingual Plane (BMP).

public static boolean

Returns:

true if the character has a defined meaning in Unicode; false otherwise.
isDefined
(char
the character to be tested
ch
)

Determines if a character is defined in Unicode.

public static boolean

Returns:

true if the character has a defined meaning in Unicode; false otherwise.
isDefined
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if a character (Unicode code point) is defined in Unicode.

public static boolean

Returns:

true if the character is a digit; false otherwise.
isDigit
(char
the character to be tested.
ch
)

Determines if the specified character is a digit.

public static boolean

Returns:

true if the character is a digit; false otherwise.
isDigit
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is a digit.

public static boolean

Returns:

true if the character is an Emoji; false otherwise.
isEmoji
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is an Emoji.

public static boolean

Returns:

true if the character is an Emoji Component; false otherwise.
isEmojiComponent
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is an Emoji Component.

public static boolean

Returns:

true if the character is an Emoji Modifier; false otherwise.
isEmojiModifier
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is an Emoji Modifier.

public static boolean

Returns:

true if the character is an Emoji Modifier Base; false otherwise.
isEmojiModifierBase
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is an Emoji Modifier Base.

public static boolean

Returns:

true if the character has the Emoji Presentation property; false otherwise.
isEmojiPresentation
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) has the Emoji Presentation property by default.

public static boolean

Returns:

true if the character is an Extended Pictographic; false otherwise.
isExtendedPictographic
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is an Extended Pictographic.

public static boolean

Returns:

true if the char value is between MIN_HIGH_SURROGATE and MAX_HIGH_SURROGATE inclusive; false otherwise.
isHighSurrogate
(char
the char value to be tested.
ch
)

Determines if the given char value is a Unicode high-surrogate code unit (also known as leading-surrogate code unit).

public static boolean

Returns:

true if the character is an ignorable control character that may be part of a Java or Unicode identifier; false otherwise.
isIdentifierIgnorable
(char
the character to be tested.
ch
)

Determines if the specified character should be regarded as an ignorable character in a Java identifier or a Unicode identifier.

public static boolean

Returns:

true if the character is an ignorable control character that may be part of a Java or Unicode identifier; false otherwise.
isIdentifierIgnorable
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) should be regarded as an ignorable character in a Java identifier or a Unicode identifier.

public static boolean

Returns:

true if the character is a Unicode ideograph character, false otherwise.
isIdeographic
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is a CJKV (Chinese, Japanese, Korean and Vietnamese) ideograph, as defined by the Unicode Standard.

public static boolean

Returns:

true if the character is an ISO control character; false otherwise.
isISOControl
(char
the character to be tested.
ch
)

Determines if the specified character is an ISO control character.

public static boolean

Returns:

true if the character is an ISO control character; false otherwise.
isISOControl
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the referenced character (Unicode code point) is an ISO control character.

public static boolean

Returns:

true if the character may be part of a Java identifier; false otherwise.
isJavaIdentifierPart
(char
the character to be tested.
ch
)

Determines if the specified character may be part of a Java identifier as other than the first character.

public static boolean

Returns:

true if the character may be part of a Java identifier; false otherwise.
isJavaIdentifierPart
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the character (Unicode code point) may be part of a Java identifier as other than the first character.

public static boolean

Returns:

true if the character may start a Java identifier; false otherwise.
isJavaIdentifierStart
(char
the character to be tested.
ch
)

Determines if the specified character is permissible as the first character in a Java identifier.

public static boolean

Returns:

true if the character may start a Java identifier; false otherwise.
isJavaIdentifierStart
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the character (Unicode code point) is permissible as the first character in a Java identifier.

public static boolean

Returns:

true if the character may start a Java identifier; false otherwise.
isJavaLetter
(char
the character to be tested.
ch
)
Deprecated since 1.1. Replaced by isJavaIdentifierStart(char).

Determines if the specified character is permissible as the first character in a Java identifier.

public static boolean

Returns:

true if the character may be part of a Java identifier; false otherwise.
isJavaLetterOrDigit
(char
the character to be tested.
ch
)
Deprecated since 1.1. Replaced by isJavaIdentifierPart(char).

Determines if the specified character may be part of a Java identifier as other than the first character.

public static boolean

Returns:

true if the character is a letter; false otherwise.
isLetter
(char
the character to be tested.
ch
)

Determines if the specified character is a letter.

public static boolean

Returns:

true if the character is a letter; false otherwise.
isLetter
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is a letter.

public static boolean

Returns:

true if the character is a letter or digit; false otherwise.
isLetterOrDigit
(char
the character to be tested.
ch
)

Determines if the specified character is a letter or digit.

public static boolean

Returns:

true if the character is a letter or digit; false otherwise.
isLetterOrDigit
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is a letter or digit.

public static boolean

Returns:

true if the character is lowercase; false otherwise.
isLowerCase
(char
the character to be tested.
ch
)

Determines if the specified character is a lowercase character.

public static boolean

Returns:

true if the character is lowercase; false otherwise.
isLowerCase
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is a lowercase character.

public static boolean

Returns:

true if the char value is between MIN_LOW_SURROGATE and MAX_LOW_SURROGATE inclusive; false otherwise.
isLowSurrogate
(char
the char value to be tested.
ch
)

Determines if the given char value is a Unicode low-surrogate code unit (also known as trailing-surrogate code unit).

public static boolean

Returns:

true if the char is mirrored, false if the char is not mirrored or is not defined.
isMirrored
(char
char for which the mirrored property is requested
ch
)

Determines whether the character is mirrored according to the Unicode specification.

public static boolean

Returns:

true if the character is mirrored, false if the character is not mirrored or is not defined.
isMirrored
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines whether the specified character (Unicode code point) is mirrored according to the Unicode specification.

public static boolean

Returns:

true if the character is ISO-LATIN-1 white space; false otherwise.
isSpace
(char
the character to be tested.
ch
)
Deprecated since 1.1. Replaced by isWhitespace(char).

Determines if the specified character is ISO-LATIN-1 white space.

public static boolean

Returns:

true if the character is a space character; false otherwise.
isSpaceChar
(char
the character to be tested.
ch
)

Determines if the specified character is a Unicode space character.

public static boolean

Returns:

true if the character is a space character; false otherwise.
isSpaceChar
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is a Unicode space character.

public static boolean

Returns:

true if the specified code point is between MIN_SUPPLEMENTARY_CODE_POINT and MAX_CODE_POINT inclusive; false otherwise.
isSupplementaryCodePoint
(int
the character (Unicode code point) to be tested
codePoint
)

Determines whether the specified character (Unicode code point) is in the supplementary character range.

public static boolean

Returns:

true if the char value is between MIN_SURROGATE and MAX_SURROGATE inclusive; false otherwise.
isSurrogate
(char
the char value to be tested.
ch
)

Determines if the given char value is a Unicode surrogate code unit.

public static boolean

Returns:

true if the specified high and low-surrogate code values represent a valid surrogate pair; false otherwise.
isSurrogatePair
(char
the high-surrogate code value to be tested
high
,
char
the low-surrogate code value to be tested
low
)

Determines whether the specified pair of char values is a valid Unicode surrogate pair.

public static boolean

Returns:

true if the character is titlecase; false otherwise.
isTitleCase
(char
the character to be tested.
ch
)

Determines if the specified character is a titlecase character.

public static boolean

Returns:

true if the character is titlecase; false otherwise.
isTitleCase
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is a titlecase character.

public static boolean

Returns:

true if the character may be part of a Unicode identifier; false otherwise.
isUnicodeIdentifierPart
(char
the character to be tested.
ch
)

Determines if the specified character may be part of a Unicode identifier as other than the first character.

public static boolean

Returns:

true if the character may be part of a Unicode identifier; false otherwise.
isUnicodeIdentifierPart
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) may be part of a Unicode identifier as other than the first character.

public static boolean

Returns:

true if the character may start a Unicode identifier; false otherwise.
isUnicodeIdentifierStart
(char
the character to be tested.
ch
)

Determines if the specified character is permissible as the first character in a Unicode identifier.

public static boolean

Returns:

true if the character may start a Unicode identifier; false otherwise.
isUnicodeIdentifierStart
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is permissible as the first character in a Unicode identifier.

public static boolean

Returns:

true if the character is uppercase; false otherwise.
isUpperCase
(char
the character to be tested.
ch
)

Determines if the specified character is an uppercase character.

public static boolean

Returns:

true if the character is uppercase; false otherwise.
isUpperCase
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is an uppercase character.

public static boolean

Returns:

true if the specified code point value is between MIN_CODE_POINT and MAX_CODE_POINT inclusive; false otherwise.
isValidCodePoint
(int
the Unicode code point to be tested
codePoint
)

Determines whether the specified code point is a valid Unicode code point value.

public static boolean

Returns:

true if the character is a Java whitespace character; false otherwise.
isWhitespace
(char
the character to be tested.
ch
)

Determines if the specified character is white space according to Java.

public static boolean

Returns:

true if the character is a Java whitespace character; false otherwise.
isWhitespace
(int
the character (Unicode code point) to be tested.
codePoint
)

Determines if the specified character (Unicode code point) is white space according to Java.

public static char

Returns:

the trailing surrogate code unit used to represent the character in the UTF-16 encoding
lowSurrogate
(int
a supplementary character (Unicode code point)
codePoint
)

Returns the trailing surrogate (a low surrogate code unit) of the surrogate pair representing the specified supplementary character (Unicode code point) in the UTF-16 encoding.

public static int

Returns:

the index within the char sequence
offsetByCodePoints
(CharSequence
the char sequence
seq
,
int
the index to be offset
index
,
int
the offset in code points
codePointOffset
)

Returns the index within the given char sequence that is offset from the given index by codePointOffset code points.

public static int

Returns:

the index within the subarray
offsetByCodePoints
(char[]
the char array
a
,
int
the index of the first char of the subarray
start
,
int
the length of the subarray in chars
count
,
int
the index to be offset
index
,
int
the offset in code points
codePointOffset
)

Returns the index within the given char subarray that is offset from the given index by codePointOffset code points.

pack-priv static int
offsetByCodePointsImpl(char[] a, int start, int count, int index, int codePointOffset)

public static char

Returns:

the value obtained by reversing (or, equivalently, swapping) the bytes in the specified char value.
reverseBytes
(char
The char of which to reverse the byte order.
ch
)

Returns the value obtained by reversing the order of the bytes in the specified char value.

public static int

Returns:

1 if the code point is a BMP code point, 2 if the code point is a supplementary code point.
toChars
(int
the character (Unicode code point) to be converted.
codePoint
,
char[]
an array of char in which the codePoint's UTF-16 value is stored.
dst
,
int
the start index into the dst array where the converted value is stored.
dstIndex
)

Converts the specified character (Unicode code point) to its UTF-16 representation.

public static char[]

Returns:

a char array having codePoint's UTF-16 representation.
toChars
(int
a Unicode code point
codePoint
)

Converts the specified character (Unicode code point) to its UTF-16 representation stored in a char array.

public static int

Returns:

the supplementary code point composed from the specified surrogate pair.
toCodePoint
(char
the high-surrogate code unit
high
,
char
the low-surrogate code unit
low
)

Converts the specified surrogate pair to its supplementary code point value.

public static char

Returns:

the lowercase equivalent of the character, if any; otherwise, the character itself.
toLowerCase
(char
the character to be converted.
ch
)

Converts the character argument to lowercase using case mapping information from the UnicodeData file.

public static int

Returns:

the lowercase equivalent of the character (Unicode code point), if any; otherwise, the character itself.
toLowerCase
(int
the character (Unicode code point) to be converted.
codePoint
)

Converts the character (Unicode code point) argument to lowercase using case mapping information from the UnicodeData file.

public String

Returns:

a string representation of this object.
toString
()

Overrides java.lang.Object.toString.

Returns a String object representing this Character's value.

public static String

Returns:

the string representation of the specified char
toString
(char
the char to be converted
c
)

Returns a String object representing the specified char.

public static String

Returns:

the string representation of the specified codePoint
toString
(int
the codePoint to be converted
codePoint
)

Returns a String object representing the specified character (Unicode code point).

pack-priv static void
toSurrogates(int codePoint, char[] dst, int index)

public static char

Returns:

the titlecase equivalent of the character, if any; otherwise, the character itself.
toTitleCase
(char
the character to be converted.
ch
)

Converts the character argument to titlecase using case mapping information from the UnicodeData file.

public static int

Returns:

the titlecase equivalent of the character, if any; otherwise, the character itself.
toTitleCase
(int
the character (Unicode code point) to be converted.
codePoint
)

Converts the character (Unicode code point) argument to titlecase using case mapping information from the UnicodeData file.

public static char

Returns:

the uppercase equivalent of the character, if any; otherwise, the character itself.
toUpperCase
(char
the character to be converted.
ch
)

Converts the character argument to uppercase using case mapping information from the UnicodeData file.

public static int

Returns:

the uppercase equivalent of the character, if any; otherwise, the character itself.
toUpperCase
(int
the character (Unicode code point) to be converted.
codePoint
)

Converts the character (Unicode code point) argument to uppercase using case mapping information from the UnicodeData file.

pack-priv static char[]

Returns:

a char[] with the uppercased character.
toUpperCaseCharArray
(int
the character (Unicode code point) to be converted.
codePoint
)

Converts the character (Unicode code point) argument to uppercase using case mapping information from the SpecialCasing file in the Unicode specification.

pack-priv static int

Returns:

either the uppercase equivalent of the character, if any, or an error flag (Character.ERROR) that indicates that a 1:M char mapping exists.
toUpperCaseEx
(int
the character (Unicode code point) to be converted.
codePoint
)

Converts the character (Unicode code point) argument to uppercase using information from the UnicodeData file.

public static Character

Returns:

a Character instance representing c.
valueOf
(char
a char value.
c
)

Returns a Character instance representing the specified char value.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait