staticint compare(const char_type* s1,const char_type* s2, std::size_t count); | (constexpr since C++17) | |
Compares the firstcount characters of the character stringss1 ands2. The comparison is done lexicographically.
Ifcount is zero, strings are considered equal.
SeeCharTraits for the general requirements on character traits forX::compare
.
s1, s2 | - | pointers to character strings to compare |
count | - | the number of characters to compare from each character string |
Negative value ifs1 isless thans2.
0 ifs1 isequal tos2.
Positive value ifs1 isgreater thans2.
Linear incount.