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