Unicode and Python - how often do you index strings?

Paul Rubin no.email at nospam.invalid
Thu Jun 5 15:58:25 EDT 2014


Ryan Hiebert <ryan at ryanhiebert.com> writes:
> How so? I was using line=line[:-1] for removing the trailing newline, and
> just replaced it with rstrip('\n'). What are you doing differently?

rstrip removes all the newlines off the end, whether there are zero or
multiple.  In perl the difference is chomp vs chop.  line=line[:-1]
removes one character, that might or might not be a newline.



More information about the Python-list mailing list