Skip to content

StringUtils.equalsIgnoreCase

Signature: StringUtils.equalsIgnoreCase(firstString, secondString)

Returns: Boolean result - true if the Strings are equal, case insensitive, or both null

Compares two Strings, returning true if they are equal ignoring the case. nulls are handled without exceptions. Two null references are considered equal. Comparison is case insensitive.

Parameters

Type Name Description Default
String firstString the first String, may be null
String secondString the second String, may be null

Example

var simpleString = "hello";
StringUtils.equalsIgnoreCase(simpleString, "HeLlO"); // true