I am currently trying to use a .txt file in java and I want to efficiently process the whole file so for instance, words that start with a capital letter and end with "ed" or "t" are printed out. I have tried implementing a "for loop" to search for the words to see if they are over the length of 5 and have the ending of "ed" or "t" I have tried using indexOf to help me find the endings.
public void word(String word)
{
if(word.length() == 5 || word.length() > 5)
{
if(word.indexOf("ed"))
word = specificWord;
System.out.println(specificWord);
}
}
However, I am having difficulties making it process capital letters. I would appreciate if anyone could be able to assist me and give me a hint on how to resolve the issue. Thank you very much. -Jeff