Stripping specified character
I'm not entirely sure how the performance will compare, but the standard way to accomplish this would be the erase-remove idiom:

str.erase(std::remove(str.begin(). str.end(), ch), str.end());


Unless the performance proves to be a bottleneck, it's typically better to stick with the C++ style of doing things.  I can't imagine that this would be significantly less efficient than the other method.  (In fact, I wouldn't be surprised if this is a bit faster for long strings with a high amount of the removed character -- though my assumption of that depends on quite a few non-guaranteed implementation choices, and a rather rough estimation of the cost of different low level operations.)