Return a copy of the string with trailing whitespace removed. If chars is given and not None, remove characters in chars instead.
>>> ' spacious '.rstrip() ' spacious' >>> 'mississippi'.rstrip('ipz') 'mississ'
builtins/str.rstrip
str.rstrip