trim whitespaces between words in a string python code example Example: python trim whitespace from end of string >>> " xyz ".rstrip() ' xyz'