Luna::BasicString::compare
i32 compare(usize pos1, usize count1, const value_type *s, usize count2) const
Compares [pos1
, pos1 + count1
) substring of this string to the characters in the range [s
, s + count2
).
Parameters
-
in pos1
The index of the first character in
*this
to compare. -
in count1
The number of characters in
*this
to compare. Ifpos1 + count1
is greater thanthis->size()
,count1
will be clamped tothis->size() - pos1
. -
in s
The string to compare with.
-
in count2
The number of characters in
s
to compare.
Valid Usage
-
pos1
must not be greater thanthis->size()
. -
If
count2
is not0
,s
must points to a valid character array with at leastcount2
characters.