Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+1 vote

I have googled and looked around to find ways to do the contains method but find a way to ignore case and I am slightly confused on how to go about doing this. everywhere that i found suggested to right a new code to assist this method. I was wondering if anyone had any other suggestions.

asked in CSC202 by (220 points)

1 Answer

0 votes

The contains method is case sensitive, in other words the contains method looks for an exact match of the characters. But what if the characters were all the same case?

We don't want to change the case of the data field title of the video item, but you could change the case (like to lower case) of a copy of the title of the video item.

Looping through the array list, if the lower case version of the current item's title was stored in a temporary local variable, then you could check if that temp title contained the search phrase.

answered by (4.3k points)
...