Lexicographically compare this string with another sequence.
Declared in <bslstl_string.h>
Lexicographically compare this string with another sequence.
int
compare(basic_string const& other) const noexcept;
» more...
Lexicographically compare this string with another sequence.
int
compare(CHAR_TYPE const* other) const;
» more...
Lexicographically compare this string with another sequence.
template<class STRING_VIEW_LIKE_TYPE>
int
compare(STRING_VIEW_LIKE_TYPE const& other) const noexcept(true);
» more...
Lexicographically compare this string with another sequence.
int
compare(
size_type lhsPosition,
size_type lhsNumChars,
CHAR_TYPE const* other) const;
» more...
Lexicographically compare this string with another sequence.
int
compare(
size_type position,
size_type numChars,
basic_string const& other) const;
» more...
Lexicographically compare this string with another sequence.
template<class STRING_VIEW_LIKE_TYPE>
int
compare(
size_type position,
size_type numChars,
STRING_VIEW_LIKE_TYPE const& other) const;
» more...
Lexicographically compare this string with another sequence.
int
compare(
size_type lhsPosition,
size_type lhsNumChars,
CHAR_TYPE const* other,
size_type otherNumChars) const;
» more...
Lexicographically compare this string with another sequence.
int
compare(
size_type lhsPosition,
size_type lhsNumChars,
basic_string const& other,
size_type otherPosition,
size_type otherNumChars = npos) const;
» more...
Lexicographically compare this string with another sequence.
template<class STRING_VIEW_LIKE_TYPE>
int
compare(
size_type lhsPosition,
size_type lhsNumChars,
STRING_VIEW_LIKE_TYPE const& other,
size_type otherPosition,
size_type otherNumChars = npos) const;
» more...
negative, zero, or positive according to the lexicographic order
| Name | Description |
|---|---|
| other | string or character sequence to compare or use |
| lhsPosition | starting index of the left-hand substring |
| lhsNumChars | length of the left-hand substring |
| position | starting index |
| numChars | number of characters |
| otherNumChars | length of the other substring |
| otherPosition | starting index in the other string |