How do I make .equals not case-sensitive?

The best way is to use str. equalsIgnoreCase(“foo”) . It’s optimized specifically for this purpose. You can also convert both strings to upper- or lowercase before comparing them with equals .

Sizin İçin Seçtik  What is case-sensitive and case insensitive in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *