Share via


StringBuffer.CompareTo(StringBuffer) Method

Definition

Compares two StringBuffer instances lexicographically.

[Android.Runtime.Register("compareTo", "(Ljava/lang/StringBuffer;)I", "", ApiSince=34)]
public int CompareTo (Java.Lang.StringBuffer another);
[<Android.Runtime.Register("compareTo", "(Ljava/lang/StringBuffer;)I", "", ApiSince=34)>]
member this.CompareTo : Java.Lang.StringBuffer -> int

Parameters

another
StringBuffer

the StringBuffer to be compared with

Returns

the value 0 if this StringBuffer contains the same character sequence as that of the argument StringBuffer; a negative integer if this StringBuffer is lexicographically less than the StringBuffer argument; or a positive integer if this StringBuffer is lexicographically greater than the StringBuffer argument.

Attributes

Remarks

Compares two StringBuffer instances lexicographically. This method follows the same rules for lexicographical comparison as defined in the java.lang.CharSequence#compare(java.lang.CharSequence, java.lang.CharSequence) CharSequence.compare(this, another) method.

For finer-grained, locale-sensitive String comparison, refer to java.text.Collator.

Added in 11.

Java documentation for java.lang.StringBuffer.compareTo(java.lang.StringBuffer).

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