Answers for "c++ replace character in string"

C++
4

c++ replace character in string

#include <algorithm>
#include <string>

void some_func() {
  std::string s = "example string";
  std::replace( s.begin(), s.end(), 'x', 'y'); // replace all 'x' to 'y'
}
Posted by: Guest on December-09-2020

Code answers related to "c++ replace character in string"

Browse Popular Code Answers by Language