Collator.Compare Method

Definition

Overloads

Compare(Object, Object)

Compares its two arguments for order.

Compare(String, String)

Compares the source string to the target string according to the collation rules for this Collator.

Compare(Object, Object)

Compares its two arguments for order.

[Android.Runtime.Register("compare", "(Ljava/lang/Object;Ljava/lang/Object;)I", "GetCompare_Ljava_lang_Object_Ljava_lang_Object_Handler")]
public virtual int Compare (Java.Lang.Object? o1, Java.Lang.Object? o2);
[<Android.Runtime.Register("compare", "(Ljava/lang/Object;Ljava/lang/Object;)I", "GetCompare_Ljava_lang_Object_Ljava_lang_Object_Handler")>]
abstract member Compare : Java.Lang.Object * Java.Lang.Object -> int
override this.Compare : Java.Lang.Object * Java.Lang.Object -> int

Parameters

o1
Object
o2
Object

Returns

Int32

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Attributes

Exceptions

if object1 or object2 is not a String.

Remarks

Java documentation for java.text.Collator.compare(java.lang.Object, java.lang.Object).

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

Compare(String, String)

Compares the source string to the target string according to the collation rules for this Collator.

[Android.Runtime.Register("compare", "(Ljava/lang/String;Ljava/lang/String;)I", "GetCompare_Ljava_lang_String_Ljava_lang_String_Handler")]
public abstract int Compare (string? source, string? target);
[<Android.Runtime.Register("compare", "(Ljava/lang/String;Ljava/lang/String;)I", "GetCompare_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member Compare : string * string -> int

Parameters

source
String

the source string.

target
String

the target string.

Returns

Int32

Returns an integer value. Value is less than zero if source is less than target, value is zero if source and target are equal, value is greater than zero if source is greater than target.

Attributes

Remarks

Java documentation for java.text.Collator.compare(java.lang.String, 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