[#BloombergLP-bslstl-StringRefImp-0c-compare]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/StringRefImp-0c.adoc[StringRefImp]::compare
:relfileprefix: ../../../
:mrdocs:

Lexicographically compare this string with `other`&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;stringref&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
compare(xref:BloombergLP/bslstl/StringRefImp-0c.adoc[StringRefImp] const& other) const;
----

== Description

Compare this and the specified `other` string objects using a lexicographical comparison and return a negative value if this string is less than `other` string, a positive value if this string is greater than `other` string, and 0 if this string is equal to `other` string&period;

== Return Value

negative, zero, or positive comparison result

== Parameters

[cols="1,4"]
|===
| Name| Description
| *other*
| string reference to compare against
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
