Purpose: This function returns the index of the first occurrence of the specified character ch in the string. If the character is not found, it returns -1.
Return Data Type:int
(ii) compareTo(String s)
Purpose: This function compares two strings lexicographically. It returns a positive integer if the calling string is lexicographically greater than the specified string s, a negative integer if it is less, and 0 if both strings are equal.