Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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'
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #replace #character #string
ADD COMMENT
Topic
Name
3+8 =