Is there a way to ignore the case for the contains() method but at the same time leave the code snippet more or less the same?
/**
* This method returns a list
Make both strings lowercase(or uppercase)
public ArrayList<String> wordsContaining(String text)
{
int index = 0;
text = text.toLowerCase();
ArrayList<String> wordsContaining = new ArrayList<String>();
while(index<words.size())
{
if((words.get(index).toLowerCase().contains(text)))
{
wordsContaining.add(words.get(index));
}
index++;
}
return wordsContaining;
}