To check for equality between two strings ignoring the case of the string characters, you use the method equalsIgnoreCase(). Let’s put these methods in the context of an example to see them working. Run It Now!
You’ll use the indexOf() method to search the quotation you used in the last example for "and" and the lastIndexOf() method to search for "the" Run It Now!