COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
string_insert_replace.cpp
Go to the documentation of this file.
1
#include <iostream>
2
#include <string>
3
using namespace
std;
4
5
int
main
()
6
{
7
string
s1 =
"Cloudy and warm."
;
8
string
s2 =
"Angel is taking programming."
;
9
string
t1 =
" very"
;
10
string
t2 =
"Nelson"
;
11
12
s1.insert(10, t1);
13
s2.replace(0, 5, t2);
14
15
cout << s1 << endl;
16
cout << s2 << endl;
17
18
return
0;
19
}
main
int main()
Definition
string_insert_replace.cpp:5
Module6
Sample Code
Part III - C++ Strings
string_insert_replace.cpp
Generated on Sun Sep 29 2024 16:39:53 for COMP2113 by
1.12.0