I would like to find 3 or more occurrences of a within a std::string in order to replace.
For example:
std::string foo = "This is a\n\n\n test";
std::string bar = "This is a\n\n\n\n test";
std::string baz = "This is a\n\n\n\n\n test";
std::string boo = "This is a\n\n\n\n\n\n test";
// ... etc.
Should all be converted to:
std::string expectedResult = "This is a\n\n test";
Vanilla stl would be appreciated (no regexp libs or boost) if possible.