Compare Strings Ignore Case
Compare a string with another one ignoring case.
Description
Returns a number indicating whether the reference string s2 comes before, after, or is equivalent to s1 string in sort order, ignoring the case.
Uses the localeCompare
JavaScript` function.
See <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank">string object</a>.
Inputs
- s1 (String): First string
- s2 (String): Second string
Outputs
- s1.localeCompare(s2) (Number): Returns -1 if (s1 < s2), 0 if (s1 == s2), and 1 if (s1 > s2). It ignores the case.