I want to replace the string text=s_o_m_e=text
with text=s-o-m-e=text
I have a starting and ending index:
std::string str("text=s_o_m_e=text");
std::string::size_type start = str.find("text="), end;
if (start != std::string::npos) {
end = str.find("=", start);
if (end != std::string::npos) {
//...
}
}
So, I'm looking for a function like this:
replaceAll(string, start, end, '_', '-');
UP:
std::replace(str.begin() + start, str.begin() + end, '_', '-');
Thanks, Blastfurnace