std::basic_string::find_last_not_of
性病:基本[医]字符串:查找[医]最后[医]不[医]成
size_type find_last_not_of( const basic_string& str, size_type pos = npos ) const; | (1) | |
---|---|---|
size_type find_last_not_of( const CharT* s, size_type pos, size_type count ) const; | (2) | |
size_type find_last_not_of( const CharT* s, size_type pos = npos ) const; | (3) | |
size_type find_last_not_of( CharT ch, size_type pos = npos ) const; | (4) | |
size_type find_last_not_of( std::basic_string_view<CharT, Traits> sv, size_type pos = npos) const | (5) | (since C++17) |
查找最后一个字符,该字符在给定字符序列中不等于任何字符。搜索只考虑间隔。0;pos如果字符不在间隔中,npos
会被归还。
1%29中的最后一个字符不等于任何字符。str
...
2%29找到最后一个字符等于第一个字符中的任何一个字符。count
所指向的字符串的字符。s
...s
可以包含空字符。
3%29查找最后一个字符,该字符串中的任何字符均为s
字符串的长度由第一个空字符决定。
4%29发现最后一个字符不等于ch
...
5%29中的最后一个字符不等于任何字符。sv
...
在所有情况下,都通过调用Traits::eq
...
参数
str | - | string identifying characters to search for |
---|---|---|
pos | - | position at which to begin searching |
count | - | length of character string identifying characters to search for |
s | - | pointer to a character string identifying characters to search fo |
ch | - | character identifying characters to search for |
sv | - | std::basic_string_view identifying the characters to search for |
返回值
已发现字符的位置或npos
如果找不到这样的角色。
例外
1-4) (none) | (until C++11) |
---|---|
1,4) noexcept specification: noexcept 2,3) (none) | (since C++11)(until C++14) |
1) noexcept specification: noexcept 2,3,4) (none) | (since C++14) |
5) noexcept specification: noexcept | (since C++17) |
例
另见
find | find characters in the string (public member function) |
---|---|
rfind | find the last occurrence of a substring (public member function) |
find_first_of | find first occurrence of characters (public member function) |
find_first_not_of | find first absence of characters (public member function) |
find_last_of | find last occurrence of characters (public member function) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
http://en.cppreference.com/w/cpp/string/basic[医]字符串/查找[医]最后[医]不[医]成