String Manipulation Practice
replace.h
9
1
2
// replaces n characters starting from start with str2
str.replace(start, n, str2)
12// replaces n characters starting from start with str2 str.replace(start, n, str2)
Taak
Swipe to start coding
- Replace the
"debug"
with"release"
. - Your program should output
mode=release
.
Oplossing
solution.cpp
99
1
2
3
4
5
6
7
8
9
10
#include <iostream>
int main()
{
std::string config = "mode=debug"; // Do not change this line
config.replace(5, 5, "release"); // Replace "debug" with "release"
std::cout << config; // Do not change this line
}
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 3. Hoofdstuk 5
single
99
1
2
3
4
5
6
7
8
9
10
#include <iostream>
int main()
{
std::string config = "mode=debug"; // Do not change this line
config.replace(___, ___, ___); // Replace "debug" with "release"
std::cout << config; // Do not change this line
}
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.