0

Is there a way to compare between strings so that uppercase and lowercase letters will be considered as the same letter?

For example, that 'ABC' == 'abc will result true

Asafwr
  • 197
  • 1
  • 3
  • 12
  • Does this answer your question? [How do I do a case-insensitive string comparison?](https://stackoverflow.com/questions/319426/how-do-i-do-a-case-insensitive-string-comparison) – WinEunuuchs2Unix Jul 28 '21 at 17:34

1 Answers1

2

Simple solution would be to convert both values to lower or upper case and make comparison if the are equal.

string1, string2 = "ABC", "abc"

string1.lower() == string2.lower()
Bijoy
  • 1,131
  • 1
  • 12
  • 23