Lexicographically compare the substring of this string of the specified numChars length starting at the specified position (or the suffix of this string starting at position if position + numChars > length()) with the specified other string, and return a negative value if the indicated substring of this string is less than other, a positive value if it is greater than other, and 0 in case of equality. CHAR_TRAITS::lt is used to compare characters. See {Lexicographical Comparisons}. Throw out_of_range if position > length().

Synopsis

Declared in <bslstl_string.h>

int
compare(
    size_type position,
    size_type numChars,
    basic_string<char8_t> const& other) const;

Created with MrDocs