Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
string::subview

Return a substring.

Synopsis
string_view
subview(
    std::size_t pos = 0,
    std::size_t count = npos) const;
Description

Returns a view of a substring.

Exception Safety

Strong guarantee.

Return Value

A string_view object referring to {data() + pos, std::min(count, size() - pos)).

Parameters

Name

Description

pos

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

count

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

Exceptions

Type

Thrown On

std::out_of_range

pos > size()


PrevUpHomeNext