So in this section about String functions:
http://www.cplusplus.com/reference/string/string/replace/
Theres an example at the bottom:
str.replace(9,5,str2); // "this is an example string."
str.replace(19,6,str3,7,6); // "this is an example phrase."
with the declarations being this:
string base="this is a test string.";
string str2="n example";
string str3="sample phrase";
string str4="useful.";
Now for this piece of code:
str.replace(
19,6,str3,7,6); // "this is an example
phrase."
...shouldn't the first parameter (19) be an 18 in order for it to work as presented in the comment?
I'm new to strings, and this confused me a little bit. But I'm pretty sure I've counted to 18 (starting from 0) instead of 19. OR maybe something else is going on here that I didn't notice?
Thanks