Add strip trailing whitespace function