Question: case insensitivity in java in my program im reading contents...
Case insensitivity in Java
In my program, I'm reading contents of a file and checking to see if each character is the same as a character specified by the user. However, the program is required to be canse insensitive, so that if the user wants to see how many "a" are in the file, each iteration of "A" is also counted. I have the following line where I'm stuck:
I receive an error that says "cannot be dereferenced" (I'm assuming because charAt(i) isn't a string?)
If I do if(line.charAt(i)==character), it works but isn't case insensitive. How would I manipulate this so that it IS case insensitive?