COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
string_insert_replace.cpp File Reference
#include <iostream>
#include <string>
Include dependency graph for string_insert_replace.cpp:

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( void )

Definition at line 5 of file string_insert_replace.cpp.

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}