If your compiler supports it (it's a c++11 addition), you could look into regex, particularly regex_replace. It has exactly the capability you want to find substrings and to replace those substrings with something else.
#include <iostream>
#include <string>
#include <regex>
int main()
{
std::string s("Something \\n\\n something \\na");
std::regex e("\\\\n");
std::string result = std::regex_replace(s, e, "\n");
std::cout << result;
}
the regex object needs all of those slashes. First to convert the c++ escape sequence to a slash, and second because the regex object then takes those slashes and converts them to its own escape sequence, so you need 4 slashes to get it to come out right.
edit: Whoops, I shouldn't have dawdled.