Kirk Strauser wrote:
At 2008-12-12T15:35:11Z, "J. Cliff Dyer" <j...@sdf.lonestar.org> writes:

Python has a version equally good:

def chomp(s):
    return s.rstrip('\r\n')

You'll hardly miss Perl at all. ;)

I haven't missed Perl in years!  I just wish there was a basestring.stripeol
method because I seem to end up writing the inline version of "chomp" every
time I iterate across a file.
>
Python is open source. You could suggest adding it and/or provide a patch.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to