[#BloombergLP-bdlb-String] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::String :relfileprefix: ../../ :mrdocs: This `struct` provides a namespace for a suite of functions on STL‐style strings (`bsl::string`, `std::string`, `std::pmr::string`), C‐style strings, and strings specified by a `(const char *, int)` or `(char *, int)` pair. == Synopsis Declared in `<bdlb_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct String; ---- == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlb/String/areEqualCaseless-010.adoc[`areEqualCaseless`] | `areEqualCaseless` overloads | xref:BloombergLP/bdlb/String/copy-01.adoc[`copy`] | `copy` overloads | xref:BloombergLP/bdlb/String/lowerCaseCmp-0c.adoc[`lowerCaseCmp`] | `lowerCaseCmp` overloads | xref:BloombergLP/bdlb/String/ltrim-03.adoc[`ltrim`] | `ltrim` overloads | xref:BloombergLP/bdlb/String/pad-00.adoc[`pad`] | `pad` overloads | xref:BloombergLP/bdlb/String/rtrim-07.adoc[`rtrim`] | `rtrim` overloads | xref:BloombergLP/bdlb/String/skipLeadingTrailing.adoc[`skipLeadingTrailing`] | Skip leading and trailing whitespace characters in the string indicated by the specified `*begin` and `*end` iterators by appropriately advancing `*begin` and regressing `*end`. If the indicated string is empty, or consists solely of whitespace characters, `*begin` is unchanged and `*end` is regressed to `*begin`. Otherwise, advance `*begin` to the first non‐whitespace character whose position is greater than or equal to `*begin` and regress `*end` to one past the position of the last non‐whitespace character whose position is less than `*end`. The indicated string need not be null‐terminated and may contain embedded null ('0') characters. The behavior is undefined unless `*begin <= *end`. Note that since `*begin` and `*end` are iterators, `*end` refers to the character one past the end of the subject string. | xref:BloombergLP/bdlb/String/strnlen.adoc[`strnlen`] | Return the minimum of the length of the specified `string` and the specified `maximumLength`. If `maximumLength` is 0, `string` may be null and 0 is returned. The behavior is undefined unless `0 <= maximumLength`. | xref:BloombergLP/bdlb/String/strrstr.adoc[`strrstr`] | Return the address providing non‐modifiable access to the last position in the specified `string` having `stringLen` characters at which the specified `subString` having `subStringLen` characters is found, or 0 if there is no such position. If `subStringLen` is 0, `subString` may be null and `string + stringLen` is returned. The behavior is undefined unless `0 <= stringLen` and `0 <= subStringLen`. See {`bdlb_stringviewutil`} for an identically named method having similar semantics taking (and returning) `bsl::string_view`. | xref:BloombergLP/bdlb/String/strrstrCaseless.adoc[`strrstrCaseless`] | Return the address providing non‐modifiable access to the last position in the specified `string` having `stringLen` characters at which the specified `subString` having `subStringLen` characters is found using case‐insensitive comparison, or 0 if there is no such position. If `subStringLen` is 0, `subString` may be null and `string + stringLen` is returned. The behavior is undefined unless `0 <= stringLen` and `0 <= subStringLen`. See {`bdlb_stringviewutil`} for an identically named method having similar semantics taking (and returning) `bsl::string_view`. | xref:BloombergLP/bdlb/String/strstr.adoc[`strstr`] | Return the address providing non‐modifiable access to the first position in the specified `string` having `stringLen` characters at which the specified `subString` having `subStringLen` characters is found, or 0 if there is no such position. If `subStringLen` is 0, `subString` may be null and `string` is returned. The behavior is undefined unless `0 <= stringLen` and `0 <= subStringLen`. See {`bdlb_stringviewutil`} for an identically named method having similar semantics taking (and returning) `bsl::string_view`. | xref:BloombergLP/bdlb/String/strstrCaseless.adoc[`strstrCaseless`] | Return the address providing non‐modifiable access to the first position in the specified `string` having `stringLen` characters at which the specified `subString` having `subStringLen` characters is found using case‐insensitive comparison, or 0 if there is no such position. If `subStringLen` is 0, `subString` may be null and `string` is returned. The behavior is undefined unless `0 <= stringLen` and `0 <= subStringLen`. See {`bdlb_stringviewutil`} for an identically named method having similar semantics taking (and returning) `bsl::string_view`. | xref:BloombergLP/bdlb/String/toFixedLength.adoc[`toFixedLength`] | Copy into the specified `dstString` at most the specified leading `dstLength` characters from the specified `srcString` having the specified `srcLength`. If `srcLength < dstLength`, after `srcString` is copied to `dstString` repeatedly append to `dstString` the optionally specified `padChar` until the total number of characters written to `dstString` is `dstLength`. If `padChar` is not specified the space (` `) character is appended. The behavior is undefined unless `0 <= dstLength` and `0 <= srcLength`. | xref:BloombergLP/bdlb/String/toLower-089.adoc[`toLower`] | `toLower` overloads | xref:BloombergLP/bdlb/String/toUpper-0f.adoc[`toUpper`] | `toUpper` overloads | xref:BloombergLP/bdlb/String/trim-0bf.adoc[`trim`] | `trim` overloads | xref:BloombergLP/bdlb/String/upperCaseCmp-036.adoc[`upperCaseCmp`] | `upperCaseCmp` overloads |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#