std::experimental::basic_string_view<CharT,Traits>::find_last_of
来自 cppreference.cn
< cpp | experimental | basic string view
| constexpr size_type find_last_of(basic_string_view v, size_type pos = npos) const noexcept; |
(1) | (库基础 TS) |
| constexpr size_type find_last_of(CharT c, size_type pos = npos) const noexcept; |
(2) | (库基础 TS) |
| constexpr size_type find_last_of(const CharT* s, size_type pos, size_type count) const; |
(3) | (库基础 TS) |
| constexpr size_type find_last_of(const CharT* s, size_type pos = npos) const; |
(4) | (库基础 TS) |
查找与给定字符序列中任何字符相等的最后一个字符。
1) 从位置
pos 开始,在此视图中查找 v 中任何字符的最后一次出现。2) 等价于 find_last_of(basic_string_view(&c, 1), pos)。
3) 等价于 find_last_of(basic_string_view(s, count), pos)。
4) 等价于 find_last_of(basic_string_view(s), pos)。
目录 |
[编辑] 参数
| v | - | 要搜索的视图 |
| pos | - | 开始搜索的位置 |
| count | - | 要搜索的字符字符串的长度 |
| s | - | 指向要搜索的字符字符串的指针 |
| ch | - | 要搜索的字符 |
[编辑] 返回值
子字符串中任何字符最后一次出现的位置,如果未找到此类字符,则为 npos。
[编辑] 复杂度
最坏情况下为 O(size() * v.size())。
[编辑] 参阅
| 在视图中查找字符 (公有成员函数) | |
| 查找子串的最后一次出现 (公有成员函数) | |
| 查找字符的首次出现 (公有成员函数) | |
| 查找字符的首次缺席 (公有成员函数) | |
| 查找字符的最后一次缺席 (公有成员函数) |