new method to strip characters from a string