Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer String Manipulation Practice | Text Data Type
C++ Data Types

book
String Manipulation Practice

replace.h

replace.h

copy
// 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

  1. Replace the "debug" with "release".
  2. Your program should output mode=release.

Oplossing

solution.cpp

solution.cpp

#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?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 3. Hoofdstuk 5
single

single

#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

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

We use cookies to make your experience better!
some-alt