a few string convenience methods in C++