Compare Strings
Compare a string with another one.
Description
Returns a number indicating whether the reference string s2 comes before, after, or is equivalent to s1 string in sort order.
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): -1 if s1 < s2, 0 if s1 == s2, 1 if s1 > s2.