I have an assignment to find all occurrences of the word “the” without using regex:
indexOfmethod to do this. The word “the” could also appear in a larger word, such as “Theresa” or “other”.
Please confirm if this is the best way to do that.
public class TheFinder
public static void main(String args)
int indexOfThe = 0;
Scanner input = new Scanner(System.in);
System.out.print("Enter a sentence with a word "the"" or type ""quit"" to quit: "");