[string.substr] (original) (raw)

21 Strings library [strings]

21.3 String classes [string.classes]

21.3.2 Class template basic_­string [basic.string]

21.3.2.7 String operations [string.ops]

21.3.2.7.3 basic_­string​::​substr [string.substr]

🔗

constexpr basic_string substr(size_type pos = 0, size_type n = npos) const;

1

#

Throws: out_­of_­rangeifpos > size().

2

#

Effects:Determines the effective length rlen of the string to copy as the smaller of n andsize() - pos.

3

#

Returns: basic_­string(data()+pos, rlen).