For string, the first character is starting from 0 or 1?
Qns 1:
1 2 3
|
string s1("LovePeaceJoy");
s1.replace(2, 3, "Love");
cout << "s1: " << s1 << endl;
|
Qns 2:
1 2 3
|
string s2("Well");
s2.append("StayHealthy",4, 4);
cout << "s2: " << s2 << endl;
|
Last edited on
What is the meaning for
s2.append("StayHealthy",4, 4); //Erase "Stay" & add "Heal"? Why erase "Stay"?
Last edited on