BloombergLP::bdlb::String

Namespace for utility functions on STL-style and C-style strings.

Synopsis

Declared in <bdlb_string.h>

struct String;

Description

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.

Static Member Functions

NameDescription
areEqualCaseless areEqualCaseless overloads
copy Return a newly allocated null-terminated copy of string.
lowerCaseCmp Compare two strings using case-insensitive ordering.
ltrim ltrim overloads
pad Pad string on the right with padChar up to length.
rtrim rtrim overloads
skipLeadingTrailing Advance *begin and regress *end past surrounding whitespace.
strnlen Return the length of string, capped at maximumLength.
strrstr Return the last occurrence of subString in string, or 0.
strrstrCaseless Return the last case-insensitive match of subString, or 0.
strstr Return the first occurrence of subString in string, or 0.
strstrCaseless Return the first case-insensitive match of subString, or 0.
toFixedLength Copy srcString into dstString, padding to dstLength if needed.
toLower Convert upper-case characters in string to lower case.
toUpper Convert lower-case characters in string to upper case.
trim trim overloads
upperCaseCmp Compare two strings as if both were converted to upper case.