I would try a method similar to this.
Note: i just wrote this method on the fly to give the OP another idea.
string remove_char_range(string const& str, unsigned const& start, unsigned const& end)
{
string newStr = "";
unsigned i = 0;
for_each(str.cbegin(),str.cend(),[&i,&newStr, &start, &end](char const& ch)
{
if (i >= start && i <= end)
{
}
else
newStr += ch;
i++;
});
return newStr;
}
I just thought I would give it a try. if anyone has a comment i would like to hear it. I am just a student and I am sure there is a better way to do this.
robNO.