[#BloombergLP-bdlb-StringRefUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::StringRefUtil
:relfileprefix: ../../
:mrdocs:

This `struct` provides a namespace for a suite of functions on `bslstl&colon;&colon;StringRef` references to strings&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;stringrefutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct StringRefUtil;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/StringRefUtil/size_type.adoc[`size&lowbar;type`] 
| Size type of string references&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/StringRefUtil/areEqualCaseless.adoc[`areEqualCaseless`] 
| Compare (the referent data of) the specified `lhs` and `rhs`&period; Return `true` if `lhs` and `rhs` are equal up to a case conversion, and `false` otherwise&period; See &lcub;Caseless Comparisons&rcub;&period;
| xref:BloombergLP/bdlb/StringRefUtil/findFirstNotOf.adoc[`findFirstNotOf`] 
| Return the position of the _first_ occurrence of a character _not_ belonging to the specified `characters`, if such an occurrence can be found in the specified `string` (on or _after_ the optionally specified `position` if such a `position` is specified), and return `k&lowbar;NPOS` otherwise&period;
| xref:BloombergLP/bdlb/StringRefUtil/findFirstOf.adoc[`findFirstOf`] 
| Return the position of the _first_ occurrence of a character belonging to the specified `characters`, if such an occurrence can can be found in the specified `string` (on or _after_ the optionally specified `position` if such a `position` is specified), and return `k&lowbar;NPOS` otherwise&period;
| xref:BloombergLP/bdlb/StringRefUtil/findLastNotOf.adoc[`findLastNotOf`] 
| Return the position of the _last_ occurrence of a character _not_ belonging to the specified `characters`, if such an occurrence can be found in the specified `string` (on or _before_ the optionally specified `position` if such a `position` is specified), and return `k&lowbar;NPOS` otherwise&period;
| xref:BloombergLP/bdlb/StringRefUtil/findLastOf.adoc[`findLastOf`] 
| Return the position of the _last_ occurrence of a character belonging to the specified `characters`, if such an occurrence can can be found in the specified `string` (on or _before_ the optionally specified `position` if such a `position` is specified), and return `k&lowbar;NPOS` otherwise&period;
| xref:BloombergLP/bdlb/StringRefUtil/lowerCaseCmp.adoc[`lowerCaseCmp`] 
| Compare (the referent data of) the specified `lhs` and `rhs`&period; Return 1 if, after a conversion to lower case, `lhs` is greater than `rhs`, 0 if `lhs` and `rhs` are equal up to a case conversion, and &hyphen;1 otherwise&period; See &lcub;Caseless Comparisons&rcub;&period;
| xref:BloombergLP/bdlb/StringRefUtil/ltrim.adoc[`ltrim`] 
| Return a `bslstl&colon;&colon;StringRef` object referring to the substring of (the referent data of) the specified `string` that excludes all leading whitespace&period; See &lcub;Whitespace Character Specification&rcub;&period; If `string` consists entirely of whitespace, return a zero&hyphen;length reference to the end of `string` (i&period;e&period;, `bslstl&colon;&colon;StringRef(string&period;end(), 0)`)&period;
| xref:BloombergLP/bdlb/StringRefUtil/rtrim.adoc[`rtrim`] 
| Return a `bslstl&colon;&colon;StringRef` object referring to the substring of (the referent data of) the specified `string` that excludes all trailing whitespace&period; See &lcub;Whitespace Character Specification&rcub;&period; If `string` consists entirely of whitespace, return a zero&hyphen;length reference to the beginning of (the referent data of) `string` (i&period;e&period;, `bslstl&colon;&colon;StringRef(string&period;data(), 0)`)&period;
| xref:BloombergLP/bdlb/StringRefUtil/strrstr.adoc[`strrstr`] 
| Return a `bslstl&colon;&colon;StringRef` object referring to the last occurrence in (the referent data of) the specified `string` at which (the referent data of) the specified `subString` is found, or `bslstl&colon;&colon;StringRef()` if there is no such occurrence&period; If `subString` has zero length then a zero&hyphen;length reference to the end of `string` is returned (i&period;e&period;, `bslstl&colon;&colon;StringRef(string&period;end(), 0)`)&semi;
| xref:BloombergLP/bdlb/StringRefUtil/strrstrCaseless.adoc[`strrstrCaseless`] 
| Return a `bslstl&colon;&colon;StringRef` object referring to the last occurrence in (the referent data of) the specified `string` at which (the referent data of) the specified `subString` is found using case&hyphen;insensitive comparisons, or `bslstl&colon;&colon;StringRef()` if there is no such occurrence&period; See &lcub;Caseless Comparisons&rcub;&period; If `subString` has zero length then a zero&hyphen;length reference to the end of `string` is returned (i&period;e&period;, `bslstl&colon;&colon;StringRef(string&period;end(), 0)`)&semi;
| xref:BloombergLP/bdlb/StringRefUtil/strstr.adoc[`strstr`] 
| Return a `bslstl&colon;&colon;StringRef` object referring to the first occurrence in (the referent data of) the specified `string` at which (the referent data of) the specified `subString` is found, or `bslstl&colon;&colon;StringRef()` if there is no such occurrence&period; If `subString` has zero length then a zero&hyphen;length reference to the beginning of `string` is returned (i&period;e&period;, `bslstl&colon;&colon;StringRef(string&period;data(), 0)`)&semi;
| xref:BloombergLP/bdlb/StringRefUtil/strstrCaseless.adoc[`strstrCaseless`] 
| Return a `bslstl&colon;&colon;StringRef` object referring to the first occurrence in (the referent data of) the specified `string` at which (the referent data of) the specified `subString` is found using case&hyphen;insensitive comparisons, or `bslstl&colon;&colon;StringRef()` if there is no such occurrence&period; See &lcub;Caseless Comparisons&rcub;&period; If `subString` has zero length then a zero&hyphen;length reference to the beginning of `string` is returned (i&period;e&period;, `bslstl&colon;&colon;StringRef(string&period;data(), 0)`)&semi;
| xref:BloombergLP/bdlb/StringRefUtil/substr.adoc[`substr`] 
| Return a string whose value is the substring starting at the optionally specified `position` in the specified `string`, of length the optionally specified `numChars` or `length() &hyphen; position`, whichever is smaller&period; If `position` is not specified, 0 is used (i&period;e&period;, the substring is from the beginning of this string)&period; If `numChars` is not specified, `k&lowbar;NPOS` is used (i&period;e&period;, the entire suffix from `position` to the end of the string is returned)&period; The behavior is undefined unless `position` is within the string boundaries (`0 &lt;&equals; position &lt;&equals; string&period;length()`)&period;
| xref:BloombergLP/bdlb/StringRefUtil/trim.adoc[`trim`] 
| Return a `bslstl&colon;&colon;StringRef` object referring to the substring of (the referent data of) the specified `string` that excludes all leading and trailing whitespace&period; See &lcub;Whitespace Character Specification&rcub;&period; If `string` consists entirely of whitespace, return a zero&hyphen;length reference to the beginning of (the referent data of) `string` (i&period;e&period;, `bslstl&colon;&colon;StringRef(string&period;data(), 0)`)&period;
| xref:BloombergLP/bdlb/StringRefUtil/upperCaseCmp.adoc[`upperCaseCmp`] 
| Compare (the referent data of) the specified `lhs` and `rhs`&period; Return 1 if, after a conversion to upper case, `lhs` is greater than `rhs`, 0 if `lhs` and `rhs` are equal up to a case conversion, and &hyphen;1 otherwise&period; See &lcub;Caseless Comparisons&rcub;&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/StringRefUtil/k_NPOS.adoc[`k&lowbar;NPOS`] 
| Value used to denote &quot;not&hyphen;a&hyphen;position&quot;, guaranteed to be outside the `range&lsqb;0 &period;&period; INT&lowbar;MAX&rsqb;`&period;
|===



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