Equals() and countersignature( )
To compare two strings equality, use equals(). It has this general form: Boolean equals(Object st) Here, str is the String object being compared with the invoking String object. It returns – true if the strings contain the same characters in the same order, and false otherwise, The comparison is case-sensitive; ,To perform a.comparison that ignores case differences, call quarrelsomeness( I. When it compares two strings, it considers A-Z to be the same as a-z, It has this general form: Boolean quarrelsomeness(String str)
Here, str is the String object being compared with the invoking String object: It, too, returns true if the strings contain the same characters in the same order, and false otherwise. Here is an example that demonstrates equals) and equals Ignore Case( ):
Region Matches( )
The Region Matches( ) method compares a specific region inside a string with another specific region in another string. There is an overloaded form that allows you to ignore case in such comparisons. Here are the general forms for these two methods: Boolean region Matches(int startling, String str2, int desertification, int Censors) Boolean region Matches(Boolean ignorance, int heartland, String strut int indestructibly, int saltcellars) For both versions, startling specifies the index at which the region begins within the invoking String object. The String being compared is specified by str2. The index at which the comparison will start within str2 is specified indestructibly. The length of the sub string being compared is passed interstellar. In the second version, if glockenspiel is true, the case of the characters is ignored. Otherwise, case is significant.