cpp:strings
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
cpp:strings [2017/05/08 05:48] – [Μεταβολή του αλφαριθμητικού] gthanos | cpp:strings [2017/05/08 05:51] – [Μεταβολή του αλφαριθμητικού] gthanos | ||
---|---|---|---|
Line 163: | Line 163: | ||
iterator erase (iterator first, iterator last);</ | iterator erase (iterator first, iterator last);</ | ||
| <code cpp> | | <code cpp> | ||
- | string& replace (size_t pos, size_t len, const char* s);</ | + | string& replace (size_t pos, size_t len, const char* s); |
+ | string& replace (size_t pos, size_t len, const string& str, | ||
+ | | ||
+ | </ | ||
| <code cpp></ | | <code cpp></ | ||
| <code cpp></ | | <code cpp></ | ||
Line 183: | Line 186: | ||
str.replace(19, | str.replace(19, | ||
str.replace(8, | str.replace(8, | ||
- | str.replace(8, | ||
- | str.replace(22, | ||
- | |||
- | // Using iterators: | ||
- | str.replace(str.begin(), | ||
- | str.replace(str.begin(), | ||
- | str.replace(str.begin()+8, | ||
- | str.replace(str.begin()+12, | ||
- | str.replace(str.begin()+11, | ||
cout << str << endl; | cout << str << endl; | ||
} | } |
cpp/strings.txt · Last modified: 2021/04/27 04:45 (external edit)