bsl::basic_string::find

find overloads

Synopses

Declared in <bslstl_string.h>

Find the first occurrence of a character in this string.

size_type
find(
    CHAR_TYPE character,
    size_type position = 0) const;
» more...

Find the first occurrence of a sequence in this string.

size_type
find(
    basic_string const& substring,
    size_type position = 0) const noexcept;
» more...

Same as the three-argument find overload with position 0.

size_type
find(
    CHAR_TYPE const* substring,
    size_type position = 0) const;
» more...

Find the first occurrence of a sequence in this string.

template<class STRING_VIEW_LIKE_TYPE>
size_type
find(
    STRING_VIEW_LIKE_TYPE const& substring,
    size_type position = 0) const noexcept(true);
» more...

Find the first occurrence of a sequence in this string.

size_type
find(
    CHAR_TYPE const* substring,
    size_type position,
    size_type numChars) const;
» more...

Return Value

position of the match, or npos if not found

Parameters

NameDescription
charactercharacter to search for
positionindex at which to start the search
substringsubstring to search for
numCharsnumber of characters