All the functions are vectorized over e1
and e2
.stri_cmp_eq
tests whether two corresponding strings
consist of exactly the same code points, while stri_cmp_neq
allow
to check whether there is any difference between them.
These are locale-independent operations: for
natural language text processing, in which the notion of canonical equivalence
is more valid, this may not be exactly what
you are looking for, see Examples.
Also note that stringi always silently removes UTF-8
BOMs from input strings,
so e.g. stri_cmp_eq
does not take BOMs into account while
comparing strings.
On the other hand, stri_cmp_equiv
test for
canonical equivalence of two strings and is locale-dependent.
Additionally, the ICU's Collator may be tuned up so that
e.g. the comparison is case-insensitive.
To test whether two strings are not canonically equivalent,
call stri_cmp_nequiv
.
What is more, stri_cmp_le
tests whether
the elements in the first vector are less than or equal to
the corresponding elements in the second vector,
stri_cmp_ge
whether they are greater or equal,
stri_cmp_lt
if less,
and stri_cmp_gt
if greater,
see also e.g. %s<%< a="">%<>
.
Finally, stri_compare
is an alias to stri_cmp
. They both
perform exactly the same locale-dependent operation.
Both functions provide a C library's strcmp()
look-and-feel,
see Value for details.
For more information on ICU's Collator and how to tune it up
in stringi, refer to stri_opts_collator
.
Please note that different locale settings may lead to different results
(see the examples below).