Equivalent of Perl chomp?

Tim Peters tim.one at home.com
Thu Jan 31 14:57:32 EST 2002


Note that

    s.endswith('\n')

is clearer than

    s[-1:] == '\n'

For real fun, time them <wink>.




More information about the Python-list mailing list