Describe the purpose and write the syntax of indexOf() function.
18 Likes
It returns the index of the first occurrence of the specified character within the string or -1 if the character is not present.
Syntax:
int <variable-name> = <string-variable>.indexOf(<character>);
Answered By
10 Likes
Describe the purpose and write the syntax of compareTo() function.
Describe the purpose and write the syntax of reverse() function.
Describe the purpose and write the syntax of startWith() function.
Describe the purpose and write the syntax of equalsIgnoreCase() function.