Removes whitespace (or other characters) from the beginning and end of a string