std::basic_string_view::substr
constexpr basic_string_view substr(size_type pos = 0, size_type count = npos ) const; | | (since C++17) |
---|
返回子字符串的视图。[pos, pos + rcount)
,在哪里rcount
是较小的count
和size() - pos
...
参数
pos | - | position of the first character |
---|---|---|
count | - | requested length |
返回值
子字符串的视图[pos, pos + rcount)
...
例外
std::out_of_range
如果pos > size()
...
复杂性
常量。
另见
copy | copies characters (public member function) |
---|---|
find | find characters in the view (public member function) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com