Share via


Character.CodePointOf(String) Method

Definition

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

[Android.Runtime.Register("codePointOf", "(Ljava/lang/String;)I", "", ApiSince=35)]
public static int CodePointOf(string name);
[<Android.Runtime.Register("codePointOf", "(Ljava/lang/String;)I", "", ApiSince=35)>]
static member CodePointOf : string -> int

Parameters

name
String

the character name

Returns

the code point value of the character specified by its name.

Attributes

Remarks

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

If a character is not assigned a name by the UnicodeData file (part of the Unicode Character Database maintained by the Unicode Consortium), its name is defined as the result of the expression:

<blockquote>Character.UnicodeBlock.of(codePoint).toString().replace('_', ' ') + " " + Integer.toHexString(codePoint).toUpperCase(Locale.ROOT);</blockquote>

The name matching is case insensitive, with any leading and trailing whitespace character removed.

For the code points in the UnicodeData file, this method recognizes the name which conforms to the name defined in the "Unicode Name Property" section in the Unicode Standard. For other code points, this method recognizes the name generated with #getName(int) method.

Added in 9.

Java documentation for java.lang.Character.codePointOf(java.lang.String).

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