small functions for C++ strings