Check if ArrayList Contains String

I know this sounds really simple and it should be, but I can’t figure out what the problem is.

I have an ArrayList of strings, such that the 627th element is "

AESTHETICS

" exactly as printed out on the console (using

arraylist.get(627)

).

When I use arraylist.contains(“AESTHETICS”), it returns false. Using this method, it also returns false:

boolean dictContains(String s) {
		for(String str: arraylist) {
			if(str.equalsIgnoreCase(s)) {
				return true;
			}
		}
		
		return false;
		
	}

Can someone please point out what the problem is?