updated the string manipulation functions to pass the mocha tests.