Depends on what kind of string you are using. The old string or the STL string.
Once you learn the STL strings they are a lot more flexible and easier to do stuff like this with.
#include <string>
using namespace std;
string dir = "/usr/local/bin";
for (string::iterator s = dir.begin(); s != dir.end(); ) {
if (s == '/')
s.erase();
else
++s;
}
I'm about 95% sure that's the way I did it. My source is at the office so if that doesn't work for you I'll doublecheck.
EDIT: Sorry I thought you said string instead of stream.