Share via


Overview | Methods | This Package | All Packages

OverviewMethodsThis PackageAll Packages

Locale.compareStrings

Compares two Strings for this locale.

Syntax

public int compareStrings( String string1**, String** string2 )

Parameters

string1

The first String object to compare.

string2

The second String object to compare.

Return Value

Returns 0 if the strings are equal; -1 if string1 is less than string2; or 1 if string1 is greater than string2.

Remarks

Use this method to compare strings of the current locale. The string comparison can be controlled by adjusting the various setCompareIgnoreXXX methods of this class.

See Also   setCompareIgnoreCase, setCompareIgnoreKana, setCompareIgnoreNonSpace, setCompareIgnoreSymbols, setCompareIgnoreWidth, setCompareIgnoreKashida