The simplest way is to convert the entire string to either to lowercase or uppercase and use the javascript indexOf, includes methods as shown below. To check for case insensitive string contains, use the regular expressions. Add suffix “i” after the string regular expression as shown.
How do you check if a string contains a substring case insensitive JavaScript?
The simplest way is to convert the entire string to either to lowercase or uppercase and use the javascript indexOf, includes methods as shown below. To check for case insensitive string contains, use the regular expressions. Add suffix “i” after the string regular expression as shown.