Collator.Compare 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
Compare(String, String) |
Compares the source text String to the target text String according to this Collator's rules, strength and decomposition mode. |
Compare(Object, Object) |
Compares the source Object to the target Object. |
Compare(String, String)
Compares the source text String to the target text String according to this Collator's rules, strength and decomposition mode.
[Android.Runtime.Register("compare", "(Ljava/lang/String;Ljava/lang/String;)I", "GetCompare_Ljava_lang_String_Ljava_lang_String_Handler", ApiSince=24)]
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", ApiSince=24)>]
abstract member Compare : string * string -> int
Parameters
- source
- String
the source String.
- target
- String
the target String.
Returns
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
Compares the source text String to the target text String according to this Collator's rules, strength and decomposition mode. Returns an integer less than, equal to or greater than zero depending on whether the source String is less than, equal to or greater than the target String. See the Collator class description for an example of use.
Java documentation for android.icu.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
Compare(Object, Object)
Compares the source Object to the target Object.
[Android.Runtime.Register("compare", "(Ljava/lang/Object;Ljava/lang/Object;)I", "GetCompare_Ljava_lang_Object_Ljava_lang_Object_Handler", ApiSince=24)]
public virtual int Compare (Java.Lang.Object? source, Java.Lang.Object? target);
[<Android.Runtime.Register("compare", "(Ljava/lang/Object;Ljava/lang/Object;)I", "GetCompare_Ljava_lang_Object_Ljava_lang_Object_Handler", ApiSince=24)>]
abstract member Compare : Java.Lang.Object * Java.Lang.Object -> int
override this.Compare : Java.Lang.Object * Java.Lang.Object -> int
Parameters
- source
- Object
the source Object.
- target
- Object
the target Object.
Returns
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
Compares the source Object to the target Object.
Java documentation for android.icu.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.