Logo

Programming-Idioms

History of Idiom 38 > diff from v34 to v35

Edit summary for version 35 by :
New Cpp implementation by user [GhassanPL]

Version 34

2016-02-16, 17:09:36

Version 35

2016-02-16, 18:37:04

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Code
auto t = s.substr(i, j-i);
Doc URL
http://www.cplusplus.com/reference/string/string/substr/