次の方法で共有


Character.Compare(Char, Char) Method

Definition

Compares two char values numerically.

[Android.Runtime.Register("compare", "(CC)I", "")]
public static int Compare (char x, char y);
[<Android.Runtime.Register("compare", "(CC)I", "")>]
static member Compare : char * char -> int

Parameters

x
Char

the first char to compare

y
Char

the second char to compare

Returns

the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y

Attributes

Remarks

Compares two char values numerically. The value returned is identical to what would be returned by:

Character.valueOf(x).compareTo(Character.valueOf(y))

Added in 1.7.

Java documentation for java.lang.Character.compare(char, 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