[#BloombergLP-bslstl-StringRefImp_CompareUtil-compare] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/StringRefImp_CompareUtil.adoc[StringRefImp_CompareUtil]::compare :relfileprefix: ../../../ :mrdocs: Compare the specified string object `a` with the specified null‐terminated C‐string `b` using a lexicographical comparison and return a negative value if `a` is less than `b`, a positive value if `a` is greater than `b`, and 0 if `a` is equal to `b`. == Synopsis Declared in `<bslstl_stringref.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class CHAR_TYPE> static int compare( xref:BloombergLP/bslstl/StringRefImp-0c.adoc[StringRefImp<CHAR_TYPE>] const& a, CHAR_TYPE const* b); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#