Elementals.js

Latest Version: 3.0 RC 1 17 July 2017

Method _.Compare.stringI

Summary:

Compares two strings after normalizing them. This operation is case insensitive.

"Normalize" means that _.stringNormalize() is called, which if the variable passed is null or undefined an empty string is returned, otherwise the result is trimmed of leading and trailing whitespace.

Calling Convention:
_.Compare.stringI(String, String)
Parameters:
String
Your strings to be normalized and compared.
Returns:
-1 if first string is alphabetically lower than the second
0 if the two strings are equal
1 if first string is alphabetically higher than the second

The various compare functions stored in elementals are meant as easy callbacks for use with _.USort.element.

Advertisement