![]() len - the number of characters to compare. ooffset - the starting offset of the subregion in the stringĪrgument. This.charAt(toffset+ k) != other.charAt(ooffset+ k) Parameters: toffset - the starting offset of the subregion in this string. There is some nonnegative integer k less than len. ![]() ooffset+len is greater than the length of the other.toffset+len is greater than the length of this.Result is false if and only if at least one of the following The substring of other to be comparedīegins at index ooffset and has length len. ![]() String object to be compared begins at index toffsetĪnd has length len. compareToIgnoreCase public int compareToIgnoreCase( String str)Ī substring of this String object is compared to a substring.Lexicographically greater than the string argument. Is lexicographically less than the string argument and a ![]() This string a value less than 0 if this string Returns: the value 0 if the argument string is equal to Whose character at position k has the smaller value, asĭetermined by using the Parameters: anotherString - the String to be compared. Positions, let k be the smallest such index then the string If they have different characters at one or more index That is a valid index for both strings, or their lengths are different, If two strings areĭifferent, then either they have different characters at some index This is the definition of lexicographic ordering. The equals(Object) method would return true. The result is zero if the stringsĪre equal compareTo returns 0 exactly when Positive integer if this String object lexicographicallyįollows the argument string. Lexicographically precedes the argument string. String object is compared lexicographically to theĬharacter sequence represented by the argument string. The character sequence represented by this The comparison is based on the Unicode value of each character in
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |