std::basic_string_view::rfind
性病:基本[医]弦[医]意见::
constexpr size_type rfind(basic_string_view v, size_type pos = npos) const; | (1) | (since C++17) |
---|---|---|
constexpr size_type rfind(CharT c, size_type pos = npos) const; | (2) | (since C++17) |
constexpr size_type rfind(const CharT* s, size_type pos, size_type count) const; | (3) | (since C++17) |
constexpr size_type rfind(const CharT* s, size_type pos = npos) const; | (4) | (since C++17) |
查找最后一个子字符串,该子字符串等于给定的字符序列。
1%29发现最后一次v
在这个视图中,从位置开始pos
...
2%29相当于rfind(basic_string_view(&c, 1), pos)
...
3%29相当于rfind(basic_string_view(s, count), pos)
...
4%29相当于rfind(basic_string_view(s), pos)
...
参数
v | - | view to search for |
---|---|---|
pos | - | position at which to start the search |
count | - | length of substring to search for |
s | - | pointer to a character string to search for |
ch | - | character to search for |
返回值
找到的子字符串或npos
如果找不到这样的子字符串。
例外
1-2%29
noexcept
规格:
noexcept
复杂性
O%28size()
%2Av.size()
%29最坏。
另见
find | find characters in the view (public member function) |
---|---|
find_first_of | find first occurrence of characters (public member function) |
find_last_of | find last occurrence of characters (public member function) |
find_first_not_of | find first absence of characters (public member function) |
find_last_not_of | find last absence of characters (public member function) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。