Problem stripping line feeds

Robert Oschler no_replies at fake_email_address.invalid
Sat Jul 24 16:37:39 EDT 2004


Hello,

I am using the following function to try and strip both carraige returns and
line feeds, ASCII 13 and 10 respectively, from a string.  It doesn't seem to
be working:

x = filter(lambda c: c not in "\012\015", string.strip(x)) # octal version

I also tried:

x = filter(lambda c: c not in "\r\n", string.strip(x)) # escape char.
version

What am I doing wrong?

Thanks
-- 
Robert





More information about the Python-list mailing list