命名空间
变体
操作

std::experimental::basic_string_view<CharT,Traits>::substr

来自 cppreference.cn
 
 
实验性
技术规范
Filesystem library (filesystem TS)
Library fundamentals (library fundamentals TS)
Library fundamentals 2 (library fundamentals TS v2)
Library fundamentals 3 (library fundamentals TS v3)
Extensions for parallelism (parallelism TS)
Extensions for parallelism 2 (parallelism TS v2)
Extensions for concurrency (concurrency TS)
Extensions for concurrency 2 (concurrency TS v2)
Concepts (concepts TS)
Ranges (ranges TS)
Reflection (reflection TS)
Mathematical special functions (special functions TR)
实验性 非TS
模式匹配
线性代数
std::execution
契约
2D图形
 
 
 
constexpr basic_string_view
    substr(size_type pos = 0, size_type count = npos ) const;

返回子字符串 [pos, pos + rcount) 的视图,其中 rcountcountsize() - pos 中较小的值。

内容

[edit] 参数

pos - 第一个字符的位置
count - 请求的长度

[edit] 返回值

子字符串 [pos, pos + rcount) 的视图。

[edit] 异常

std::out_of_range 如果 pos > size()

[edit] 复杂度

常数。

[edit] 参见

复制字符
(public member function) [编辑]
在视图中查找字符
(public member function) [编辑]