Answers for "how to change a character in c++"

C++
6

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 "how to change a character in c++"

Browse Popular Code Answers by Language