alphaNumCmp
alphaNumCmp(S_arg1S_arg2[g_arg3] ) => 1 / 0 / -1
Description
Compares two string or symbol names alphanumerically or numerically.
If the third optional argument is non-nil and the first two arguments are strings holding purely numeric values, then a numeric comparison is performed on the numeric representation of the strings.
Arguments
|
If non- |
Value Returned
Examples
alphaNumCmp( "a" "b" )
=> -1
alphaNumCmp( "b" "a" )
=> 1
alphaNumCmp( "name12" "name12" )
=> 0
alphaNumCmp( "name23" "name12" )
=> 1
alphaNumCmp( "00.09" "9.0E-2" t)
=> 0
Related Topics
Return to top