Sdílet prostřednictvím


Character.IsDigit Method

Definition

Overloads

IsDigit(Char)

Determines if the specified character is a digit.

IsDigit(Int32)

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

IsDigit(Char)

Determines if the specified character is a digit.

[Android.Runtime.Register("isDigit", "(C)Z", "")]
public static bool IsDigit (char ch);
[<Android.Runtime.Register("isDigit", "(C)Z", "")>]
static member IsDigit : char -> bool

Parameters

ch
Char

the character to be tested.

Returns

true if the character is a digit; false otherwise.

Attributes

Remarks

Determines if the specified character is a digit.

A character is a digit if its general category type, provided by Character.getType(ch), is DECIMAL_DIGIT_NUMBER.

Some Unicode character ranges that contain digits: <ul> <li>'\u005Cu0030' through '\u005Cu0039', ISO-LATIN-1 digits ('0' through '9') <li>'\u005Cu0660' through '\u005Cu0669', Arabic-Indic digits <li>'\u005Cu06F0' through '\u005Cu06F9', Extended Arabic-Indic digits <li>'\u005Cu0966' through '\u005Cu096F', Devanagari digits <li>'\u005CuFF10' through '\u005CuFF19', Fullwidth digits </ul>

Many other character ranges contain digits as well.

<b>Note:</b> This method cannot handle supplementary characters. To support all Unicode characters, including supplementary characters, use the #isDigit(int) method.

Java documentation for java.lang.Character.isDigit(char).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

IsDigit(Int32)

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

[Android.Runtime.Register("isDigit", "(I)Z", "")]
public static bool IsDigit (int codePoint);
[<Android.Runtime.Register("isDigit", "(I)Z", "")>]
static member IsDigit : int -> bool

Parameters

codePoint
Int32

the character (Unicode code point) to be tested.

Returns

true if the character is a digit; false otherwise.

Attributes

Remarks

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

A character is a digit if its general category type, provided by Character#getType(int) getType(codePoint), is DECIMAL_DIGIT_NUMBER.

Some Unicode character ranges that contain digits: <ul> <li>'\u005Cu0030' through '\u005Cu0039', ISO-LATIN-1 digits ('0' through '9') <li>'\u005Cu0660' through '\u005Cu0669', Arabic-Indic digits <li>'\u005Cu06F0' through '\u005Cu06F9', Extended Arabic-Indic digits <li>'\u005Cu0966' through '\u005Cu096F', Devanagari digits <li>'\u005CuFF10' through '\u005CuFF19', Fullwidth digits </ul>

Many other character ranges contain digits as well.

Added in 1.5.

Java documentation for java.lang.Character.isDigit(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to