Equivalent of Perl chomp?

Stefan Schwarzer s.schwarzer at ndh.net
Thu Jan 31 18:38:01 EST 2002


Stefan Schwarzer wrote:
> Some say they miss chomp, some not. (And I can't remember ever desiring
> it in Python, though I used chomp sometimes in my Perl days.)

A thought on that I just had: In all my string processing applications
I can remember, it was ok to either
- remove all the trailing whitespace with s.rstrip() or
- process a string with all its trailing whitespace in it, including \n's

Stefan



More information about the Python-list mailing list