Android Guides | Samples

Java.Lang.Character Class

The wrapper for the primitive type char.

See Also: Character

Syntax

[Android.Runtime.Register("java/lang/Character", DoNotGenerateAcw=true)]
public sealed class Character : Object, ISerializable, IComparable, IConvertible, IDisposable

Remarks

The wrapper for the primitive type char. This class also provides a number of utility methods for working with characters.

Character data is kept up to date as Unicode evolves. See the Locale data section of the Locale documentation for details of the Unicode versions implemented by current and historical Android releases.

The Unicode specification, character tables, and other information are available at .

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.

Unicode categories

Here's a list of the Unicode character categories and the corresponding Java constant, grouped semantically to provide a convenient overview. This table is also useful in conjunction with \p and \P in Pattern.

Cn Unassigned Character.Unassigned
Cc Control Character.Control
Cf Format Character.Format
Co Private use Character.PrivateUse
Cs Surrogate Character.Surrogate

Lu Uppercase letter Character.UppercaseLetter
Ll Lowercase letter Character.LowercaseLetter
Lt Titlecase letter Character.TitlecaseLetter
Lm Modifier letter Character.ModifierLetter
Lo Other letter Character.OtherLetter

Mn Non-spacing mark Character.NonSpacingMark
Me Enclosing mark Character.EnclosingMark
Mc Combining spacing mark Character.CombiningSpacingMark

Nd Decimal digit number Character.DecimalDigitNumber
Nl Letter number Character.LetterNumber
No Other number Character.OtherNumber

Pd Dash punctuation Character.DashPunctuation
Ps Start punctuation Character.StartPunctuation
Pe End punctuation Character.EndPunctuation
Pc Connector punctuation Character.ConnectorPunctuation
Pi Initial quote punctuation Character.InitialQuotePunctuation
Pf Final quote punctuation Character.FinalQuotePunctuation
Po Other punctuation Character.OtherPunctuation

Sm Math symbol Character.MathSymbol
Sc Currency symbol Character.CurrencySymbol
Sk Modifier symbol Character.ModifierSymbol
So Other symbol Character.OtherSymbol

Zs Space separator Character.SpaceSeparator
Zl Line separator Character.LineSeparator
Zp Paragraph separator Character.ParagraphSeparator

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Java.Lang.Character are listed below.

See Also: Object

Public Constructors

Constructs a new Character with the specified primitive char value.

Public Fields

const
CombiningSpacingMarkSByte (8). Unicode category constant Mc.
const
ConnectorPunctuationSByte (23). Unicode category constant Pc.
const
ControlSByte (15). Unicode category constant Cc.
const
CurrencySymbolSByte (26). Unicode category constant Sc.
const
DashPunctuationSByte (20). Unicode category constant Pd.
const
DecimalDigitNumberSByte (9). Unicode category constant Nd.
const
DirectionalityArabicNumberSByte (6). Unicode bidirectional constant AN.
const
DirectionalityBoundaryNeutralSByte (9). Unicode bidirectional constant BN.
const
DirectionalityCommonNumberSeparatorSByte (7). Unicode bidirectional constant CS.
const
DirectionalityEuropeanNumberSByte (3). Unicode bidirectional constant EN.
const
DirectionalityEuropeanNumberSeparatorSByte (4). Unicode bidirectional constant ES.
const
DirectionalityEuropeanNumberTerminatorSByte (5). Unicode bidirectional constant ET.
const
DirectionalityLeftToRightSByte (0). Unicode bidirectional constant L.
const
DirectionalityLeftToRightEmbeddingSByte (14). Unicode bidirectional constant LRE.
const
DirectionalityLeftToRightOverrideSByte (15). Unicode bidirectional constant LRO.
const
DirectionalityNonspacingMarkSByte (8). Unicode bidirectional constant NSM.
const
DirectionalityOtherNeutralsSByte (13). Unicode bidirectional constant ON.
const
DirectionalityParagraphSeparatorSByte (10). Unicode bidirectional constant B.
const
DirectionalityPopDirectionalFormatSByte (18). Unicode bidirectional constant PDF.
const
DirectionalityRightToLeftSByte (1). Unicode bidirectional constant R.
const
DirectionalityRightToLeftArabicSByte (2). Unicode bidirectional constant AL.
const
DirectionalityRightToLeftEmbeddingSByte (16). Unicode bidirectional constant RLE.
const
DirectionalityRightToLeftOverrideSByte (17). Unicode bidirectional constant RLO.
const
DirectionalitySegmentSeparatorSByte (11). Unicode bidirectional constant S.
const
DirectionalityUndefinedSByte (-1). Unicode bidirectional constant.
const
DirectionalityWhitespaceSByte (12). Unicode bidirectional constant WS.
const
EnclosingMarkSByte (7). Unicode category constant Me.
const
EndPunctuationSByte (22). Unicode category constant Pe.
const
FinalQuotePunctuationSByte (30). Unicode category constant Pf.
const
FormatSByte (16). Unicode category constant Cf.
const
InitialQuotePunctuationSByte (29). Unicode category constant Pi.
const
LetterNumberSByte (10). Unicode category constant Nl.
const
LineSeparatorSByte (13). Unicode category constant Zl.
const
LowercaseLetterSByte (2). Unicode category constant Ll.
const
MathSymbolSByte (25). Unicode category constant Sm.
const
MaxCodePointInt32 (1114111). The maximum code point value, U+10FFFF.
const
MaxHighSurrogateChar. The maximum value of a high surrogate or leading surrogate unit in UTF-16 encoding, '?'.
const
MaxLowSurrogateChar. The maximum value of a low surrogate or trailing surrogate unit in UTF-16 encoding, '?'.
const
MaxRadixInt32 (36). The maximum radix used for conversions between characters and integers.
const
MaxSurrogateChar. The maximum value of a surrogate unit in UTF-16 encoding, '?'.
const
MaxValueChar. The maximum Character value.
const
MinCodePointInt32 (0). The minimum code point value, U+0000.
const
MinHighSurrogateChar. The minimum value of a high surrogate or leading surrogate unit in UTF-16 encoding, '?'.
const
MinLowSurrogateChar. The minimum value of a low surrogate or trailing surrogate unit in UTF-16 encoding, '?'.
const
MinRadixInt32 (2). The minimum radix used for conversions between characters and integers.
const
MinSupplementaryCodePointInt32 (65536). The minimum value of a supplementary code point, U+010000.
const
MinSurrogateChar. The minimum value of a surrogate unit in UTF-16 encoding, '?'.
const
MinValueChar. The minimum Character value.
const
ModifierLetterSByte (4). Unicode category constant Lm.
const
ModifierSymbolSByte (27). Unicode category constant Sk.
const
NonSpacingMarkSByte (6). Unicode category constant Mn.
const
OtherLetterSByte (5). Unicode category constant Lo.
const
OtherNumberSByte (11). Unicode category constant No.
const
OtherPunctuationSByte (24). Unicode category constant Po.
const
OtherSymbolSByte (28). Unicode category constant So.
const
ParagraphSeparatorSByte (14). Unicode category constant Zp.
const
PrivateUseSByte (18). Unicode category constant Co.
const
SizeInt32 (16). The number of bits required to represent a Character value unsigned form.
const
SpaceSeparatorSByte (12). Unicode category constant Zs.
const
StartPunctuationSByte (21). Unicode category constant Ps.
const
SurrogateSByte (19). Unicode category constant Cs.
const
TitlecaseLetterSByte (3). Unicode category constant Lt.
const
UnassignedSByte (0). Unicode category constant Cn.
const
UppercaseLetterSByte (1). Unicode category constant Lu.

Public Properties

[read-only]
static
TypeClass. The Class object that represents the primitive type char.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

static
CharCount(Int32) : Int32
Calculates the number of char values required to represent the specified Unicode code point.
CharValue() : Char
Gets the primitive value of this character.
static
CodePointAt(ICharSequence, Int32) : Int32
Returns the code point at index in the specified sequence of character units.
static
CodePointAt(Char[], Int32) : Int32
Returns the code point at index in the specified array of character units.
static
CodePointAt(String, Int32) : Int32
static
CodePointAt(Char[], Int32, Int32) : Int32
Returns the code point at index in the specified array of character units, where index has to be less than limit.
static
CodePointBefore(ICharSequence, Int32) : Int32
Returns the code point that precedes index in the specified sequence of character units.
static
CodePointBefore(Char[], Int32) : Int32
Returns the code point that precedes index in the specified array of character units.
static
CodePointBefore(String, Int32) : Int32
static
CodePointBefore(Char[], Int32, Int32) : Int32
Returns the code point that precedes the index in the specified array of character units and is not less than start.
static
CodePointCount(ICharSequence, Int32, Int32) : Int32
Counts the number of Unicode code points in the subsequence of the specified character sequence, as delineated by beginIndex and endIndex.
static
CodePointCount(Char[], Int32, Int32) : Int32
Counts the number of Unicode code points in the subsequence of the specified char array, as delineated by offset and count.
static
CodePointCount(String, Int32, Int32) : Int32
static
Compare(Char, Char) : Int32
Compares two char values.
CompareTo(Character) : Int32
Compares this object to the specified character object to determine their relative order.
static
Digit(Char, Int32) : Int32
Convenience method to determine the value of the specified character c in the supplied radix.
static
Digit(Int32, Int32) : Int32
Convenience method to determine the value of the character codePoint in the supplied radix.
static
ForDigit(Int32, Int32) : Char
Returns the character which represents the specified digit in the specified radix.
static
GetDirectionality(Char) : SByte
Gets the Unicode directionality of the specified character.
static
GetDirectionality(Int32) : SByte
Returns the Unicode directionality of the given code point.
static
GetName(Int32) : String
Returns a human-readable name for the given code point, or null if the code point is unassigned.
static
GetNumericValue(Char) : Int32
Returns the numeric value of the specified Unicode character.
static
GetNumericValue(Int32) : Int32
Gets the numeric value of the specified Unicode code point.
static
GetType(Char) : Int32
Gets the general Unicode category of the specified character.
static
GetType(Int32) : Int32
Gets the general Unicode category of the specified code point.
static
HighSurrogate(Int32) : Char
Returns the high surrogate for the given code point.
static
IsAlphabetic(Int32) : Boolean
Returns true if the given code point is alphabetic.
static
IsBmpCodePoint(Int32) : Boolean
Returns true if the given code point is in the Basic Multilingual Plane (BMP).
static
IsDefined(Char) : Boolean
Indicates whether the specified character is defined in the Unicode specification.
static
IsDefined(Int32) : Boolean
Indicates whether the specified code point is defined in the Unicode specification.
static
IsDigit(Char) : Boolean
Indicates whether the specified character is a digit.
static
IsDigit(Int32) : Boolean
Indicates whether the specified code point is a digit.
static
IsHighSurrogate(Char) : Boolean
Indicates whether ch is a high- (or leading-) surrogate code unit that is used for representing supplementary characters in UTF-16 encoding.
static
IsIdentifierIgnorable(Char) : Boolean
Indicates whether the specified character is ignorable in a Java or Unicode identifier.
static
IsIdentifierIgnorable(Int32) : Boolean
Indicates whether the specified code point is ignorable in a Java or Unicode identifier.
static
IsIdeographic(Int32) : Boolean
Returns true if the given code point is a CJKV ideographic character.
static
IsISOControl(Char) : Boolean
Indicates whether the specified character is an ISO control character.
static
IsISOControl(Int32) : Boolean
Indicates whether the specified code point is an ISO control character.
static
IsJavaIdentifierPart(Char) : Boolean
Indicates whether the specified character is a valid part of a Java identifier other than the first character.
static
IsJavaIdentifierPart(Int32) : Boolean
Indicates whether the specified code point is a valid part of a Java identifier other than the first character.
static
IsJavaIdentifierStart(Char) : Boolean
Indicates whether the specified character is a valid first character for a Java identifier.
static
IsJavaIdentifierStart(Int32) : Boolean
Indicates whether the specified code point is a valid first character for a Java identifier.
static
IsJavaLetter(Char) : Boolean
Indicates whether the specified character is a Java letter.
static
IsJavaLetterOrDigit(Char) : Boolean
Indicates whether the specified character is a Java letter or digit character.
static
IsLetter(Char) : Boolean
Indicates whether the specified character is a letter.
static
IsLetter(Int32) : Boolean
Indicates whether the specified code point is a letter.
static
IsLetterOrDigit(Char) : Boolean
Indicates whether the specified character is a letter or a digit.
static
IsLetterOrDigit(Int32) : Boolean
Indicates whether the specified code point is a letter or a digit.
static
IsLowerCase(Char) : Boolean
Indicates whether the specified character is a lower case letter.
static
IsLowerCase(Int32) : Boolean
Indicates whether the specified code point is a lower case letter.
static
IsLowSurrogate(Char) : Boolean
Indicates whether ch is a low- (or trailing-) surrogate code unit that is used for representing supplementary characters in UTF-16 encoding.
static
IsMirrored(Char) : Boolean
Indicates whether the specified character is mirrored.
static
IsMirrored(Int32) : Boolean
Indicates whether the specified code point is mirrored.
static
IsSpace(Char) : Boolean
Use Character.IsWhitespace(Char) instead.
static
IsSpaceChar(Char) : Boolean
See Character.IsSpaceChar(Int32).
static
IsSpaceChar(Int32) : Boolean
Returns true if the given code point is a Unicode space character.
static
IsSupplementaryCodePoint(Int32) : Boolean
Indicates whether codePoint is within the supplementary code point range.
static
IsSurrogate(Char) : Boolean
Returns true if the given character is a high or low surrogate.
static
IsSurrogatePair(Char, Char) : Boolean
Indicates whether the specified character pair is a valid surrogate pair.
static
IsTitleCase(Char) : Boolean
Indicates whether the specified character is a titlecase character.
static
IsTitleCase(Int32) : Boolean
Indicates whether the specified code point is a titlecase character.
static
IsUnicodeIdentifierPart(Char) : Boolean
Indicates whether the specified character is valid as part of a Unicode identifier other than the first character.
static
IsUnicodeIdentifierPart(Int32) : Boolean
Indicates whether the specified code point is valid as part of a Unicode identifier other than the first character.
static
IsUnicodeIdentifierStart(Char) : Boolean
Indicates whether the specified character is a valid initial character for a Unicode identifier.
static
IsUnicodeIdentifierStart(Int32) : Boolean
Indicates whether the specified code point is a valid initial character for a Unicode identifier.
static
IsUpperCase(Char) : Boolean
Indicates whether the specified character is an upper case letter.
static
IsUpperCase(Int32) : Boolean
Indicates whether the specified code point is an upper case letter.
static
IsValidCodePoint(Int32) : Boolean
Indicates whether codePoint is a valid Unicode code point.
static
IsWhitespace(Char) : Boolean
See Character.IsWhitespace(Int32).
static
IsWhitespace(Int32) : Boolean
Returns true if the given code point is a Unicode whitespace character.
static
LowSurrogate(Int32) : Char
Returns the low surrogate for the given code point.
static
OffsetByCodePoints(ICharSequence, Int32, Int32) : Int32
Determines the index in the specified character sequence that is offset codePointOffset code points from index.
static
OffsetByCodePoints(String, Int32, Int32) : Int32
static
OffsetByCodePoints(Char[], Int32, Int32, Int32, Int32) : Int32
Determines the index in a subsequence of the specified character array that is offset codePointOffset code points from index.
static
ReverseBytes(Char) : Char
Reverses the order of the first and second byte in the specified character.
static
ToChars(Int32) : Char[]
Converts the specified Unicode code point into a UTF-16 encoded sequence and returns it as a char array.
static
ToChars(Int32, Char[], Int32) : Int32
Converts the specified Unicode code point into a UTF-16 encoded sequence and copies the value(s) into the char array dst, starting at index dstIndex.
static
ToCodePoint(Char, Char) : Int32
Converts a surrogate pair into a Unicode code point.
static
ToLowerCase(Char) : Char
Returns the lower case equivalent for the specified character if the character is an upper case letter.
static
ToLowerCase(Int32) : Int32
Returns the lower case equivalent for the specified code point if it is an upper case letter.
static
ToString(Char) : String
Converts the specified character to its string representation.
static
ToTitleCase(Char) : Char
Returns the title case equivalent for the specified character if it exists.
static
ToTitleCase(Int32) : Int32
Returns the title case equivalent for the specified code point if it exists.
static
ToUpperCase(Char) : Char
Returns the upper case equivalent for the specified character if the character is a lower case letter.
static
ToUpperCase(Int32) : Int32
Returns the upper case equivalent for the specified code point if the code point is a lower case letter.
static
ValueOf(Char) : Character
Returns a Character instance for the char value passed.

Public Operators

static
Conversion to System.Char(Explicit)

Explicitly Implemented Interface Members