Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the develop branch, built from commit e60898da42.
PrevUpHomeNext

basic_static_string::substr

Return a substring.

Synopsis
constexpr basic_static_string
substr(
    size_type pos = 0,
    size_type count = npos) const;
Description

Returns a substring of the string.

Exception Safety

Strong guarantee.

Return Value

A string object containing the characters {data() + pos, std::min(count, size() - pos)).

Parameters

Name

Description

pos

The index to being the substring at. The default arugment for this parameter is 0.

count

The length of the substring. The default arugment for this parameter is npos.

Exceptions

Type

Thrown On

std::out_of_range

pos > size()


PrevUpHomeNext