removes whitespace from both the beginning and end of a string code example Example: python trim whitespace from end of string >>> " xyz ".rstrip() ' xyz'