Skip to content
Advertisement

Ignoring upper case and lower case in Java

I want to know how to make whatever the user inputs to ignore case in my method:

JavaScript

Advertisement

Answer

You have to use the String method .toLowerCase() or .toUpperCase() on both the input and the string you are trying to match it with.

Example:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement