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;

Find the first occurrence of a sequence in this string.

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

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

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

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);

Find the first occurrence of a sequence in this string.

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

Return Value

position of the match, or npos if not found

Parameters

Name

Description

character

character to search for

position

index at which to start the search

substring

substring to search for

numChars

number of characters

Created with MrDocs