some string computations