To do case insensitive search, you can use regular expressions and the String#match() function , or you can convert both the string and substring to lower case using the String#toLowerCase() function.
Read moreIs indexOf case-sensitive?
The indexOf() method returns the index number where the target string is first found or -1 if the target is not found. Like equals(), the indexOf() method is case-sensitive , so uppercase and lowercase chars are considered to be different.
Read more