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:26] – [Διάτρεξη] gthanos | cpp:strings [2017/05/08 05:48] – [Μεταβολή του αλφαριθμητικού] gthanos | ||
---|---|---|---|
Line 153: | Line 153: | ||
string& operator+= (const char* s); | string& operator+= (const char* s); | ||
string& operator+= (char c);</ | string& operator+= (char c);</ | ||
+ | | <code cpp> | ||
+ | string& append (const char* str);</ | ||
+ | | <code cpp> | ||
+ | string& assign (const char* str)</ | ||
+ | | <code cpp> | ||
+ | string& insert (size_t pos, const char* str);</ | ||
+ | | <code cpp> | ||
+ | iterator erase (iterator p); | ||
+ | iterator erase (iterator first, iterator last);</ | ||
+ | | <code cpp> | ||
+ | string& replace (size_t pos, size_t len, const char* s);</ | ||
| <code cpp></ | | <code cpp></ | ||
| <code cpp></ | | <code cpp></ | ||
| <code cpp></ | | <code cpp></ | ||
- | | | + | |
- | | | + | < |
- | | <code cpp></code> | + | # |
- | | <code cpp></code> | + | # |
- | | <code cpp></ | + | using namespace std; |
+ | |||
+ | int main () { | ||
+ | string base=" | ||
+ | string str2=" | ||
+ | string str3=" | ||
+ | string str4=" | ||
+ | |||
+ | string str=base; | ||
+ | str.replace(9, | ||
+ | | ||
+ | str.replace(8, | ||
+ | | ||
+ | str.replace(22, | ||
+ | |||
+ | | ||
+ | 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; | ||
+ | } | ||
+ | </ | ||
- | === Σύγκριση, | + | ==== Σύγκριση, |
| <code cpp></ | | <code cpp></ |
cpp/strings.txt · Last modified: 2021/04/27 04:45 (external edit)