xtd 0.2.0
Loading...
Searching...
No Matches

◆ compare() [5/6]

static int32 xtd::ustring::compare ( const ustring str_a,
size_t  index_a,
const ustring str_b,
size_t  index_b,
size_t  length,
bool  ignore_case 
)
staticnoexcept

Compares substrings of two specified string objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order.

Parameters
str_aThe first string to use in the comparison.
index_aThe position of the substring within str_a.
str_bThe second string to use in the comparison.
index_bThe position of the substring within str_b.
lengthThe maximum number of characters in the substrings to compare
ignore_casetrue to ignore case during the comparison; otherwise, false.
Returns
A 32-bit signed integer that indicates the lexical relationship between the two compares.
Value Condition
Less than zero str_a precedes str_b in the sort order.
Zero str_a occurs in the same position as str_b in the sort order.
Greater than zero str_a follows str_b in the sort order.