20
Strings library
[strings]
20.3
String classes
[string.classes]
20.3.2
Class template
basic_string
[basic.string]
20.3.2.7
String operations
[string.ops]
20.3.2.7.8
basic_string::substr
[string.substr]
🔗
basic_string substr(size_type pos = 0, size_type n = npos) const;
1
#
Throws:
out_of_range
if
pos > size()
.
2
#
Effects:
Determines the effective length
rlen
of the string to copy as the smaller of
n
and
size() - pos
.
3
#
Returns:
basic_string(data()+pos, rlen)
.