string::find_last_not_of

Find the last character missing from the specified string.

Synopsis

std::size_t
find_last_not_of(
    string_view sv,
    std::size_t pos = string::npos) const noexcept; (1)

std::size_t
find_last_not_of(
    char ch,
    std::size_t pos = string::npos) const noexcept; (2)

Description

Search from pos backwards for the first character in this string that is not equal to any of the characters in the string provided as the first argument. If pos is equal to npos (the default), search from the last character.

  • (1) compares with the characters in sv.

  • (2) compares with the character ch.

Complexity

Exception Safety

No-throw guarantee.

Return Value

The index of the found character, or npos if none exists.

Parameters

Name Description

sv

The characters to compare with.

pos

The index to start searching at.

ch

The character to compare with.