UCharacter.Digit Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Digit(Int32) |
Returnss the numeric value of a decimal digit code point. |
Digit(Int32, Int32) |
Returnss the numeric value of a decimal digit code point. |
Digit(Int32)
Returnss the numeric value of a decimal digit code point.
[Android.Runtime.Register("digit", "(I)I", "", ApiSince=24)]
public static int Digit (int ch);
[<Android.Runtime.Register("digit", "(I)I", "", ApiSince=24)>]
static member Digit : int -> int
Parameters
- ch
- Int32
the code point to query
Returns
the numeric value represented by the code point, or -1 if the code point is not a decimal digit or if its value is too large for a decimal radix
- Attributes
Remarks
Returnss the numeric value of a decimal digit code point. <br>This is a convenience overload of digit(int, int)
that provides a decimal radix. <br><em>Semantic Change:</em> In release 1.3.1 and prior, this treated numeric letters and other numbers as digits. This has been changed to conform to the java semantics.
Java documentation for android.icu.lang.UCharacter.digit(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
Digit(Int32, Int32)
Returnss the numeric value of a decimal digit code point.
[Android.Runtime.Register("digit", "(II)I", "", ApiSince=24)]
public static int Digit (int ch, int radix);
[<Android.Runtime.Register("digit", "(II)I", "", ApiSince=24)>]
static member Digit : int * int -> int
Parameters
- ch
- Int32
the code point to query
- radix
- Int32
the radix
Returns
the numeric value represented by the code point in the specified radix, or -1 if the code point is not a decimal digit or if its value is too large for the radix
- Attributes
Remarks
Returnss the numeric value of a decimal digit code point. <br>This method observes the semantics of java.lang.Character.digit()
. Note that this will return positive values for code points for which isDigit returns false, just like java.lang.Character. <br><em>Semantic Change:</em> In release 1.3.1 and prior, this did not treat the European letters as having a digit value, and also treated numeric letters and other numbers as digits. This has been changed to conform to the java semantics. <br>A code point is a valid digit if and only if: <ul> <li>ch is a decimal digit or one of the european letters, and <li>the value of ch is less than the specified radix. </ul>
Java documentation for android.icu.lang.UCharacter.digit(int, 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.