added string utility functions and tests