Snippets tagged “case-insensitive”
5 snippets use this tag.
- How do I do a case-insensitive string comparison?Python
You can convert both strings to lowercase or uppercase (using the lower() or upper() method) before doing the comparison.
- How to check if a String contains another String in a case insensitive manner in Java?Java
To check if a String contains another String in a case-insensitive manner in Java, you can use the toLowerCase() method of the String class and the contains() method.
- How to Replace a Word Inside a PHP StringPHP
Sometimes, it is necessary to replace a given word inside a string in PHP. Here, we will consider three helpful functions that help to carry out the task.
- Ignore case sensitivity when comparing strings in PHPPHP
In PHP, you can use the strcasecmp() function to compare two strings and ignore case sensitivity.
- In Java, how do I check if a string contains a substring (ignoring case)?Java
To check if a string contains a substring (ignoring case) in Java, you can use the contains method of the String class and the equalsIgnoreCase method.