BloombergLP::bdlb::StringRefUtil::strstrCaseless

Return a reference to the first case-insensitive occurrence of subString in string.

Synopsis

Declared in <bdlb_stringrefutil.h>

static
bslstl::StringRef
strstrCaseless(
    bslstl::StringRef const& string,
    bslstl::StringRef const& subString);

Description

Return a bslstl::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-insensitive comparisons, or bslstl::StringRef() if there is no such occurrence. See {Caseless Comparisons}. If subString has zero length then a zero-length reference to the beginning of string is returned (i.e., bslstl::StringRef(string.data(), 0));

Return Value

reference to the first occurrence, or an empty reference

Parameters

NameDescription
stringstring to search
subStringsubstring to find