[#bsl-basic_string-0faf-compare-057] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic_string]::compare :relfileprefix: ../../ :mrdocs: Lexicographically compare this string with another sequence. == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int compare(xref:bsl/basic_string-0faf.adoc[basic_string] const& other) const noexcept; ---- == Return Value negative, zero, or positive according to the lexicographic order == Parameters [cols="1,4"] |=== | Name| Description | *other* | string or character sequence to compare or use |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#