Is there an equivalent to Perl's chomp() for removing trailing newlines from strings?

Starting with Python 2.2, rstrip lets you pass in what characters you want to remove from the end of a string. Use S.rstrip(“\r