Franz Steinhaeusler wrote: > On Thu, 23 Feb 2006 13:54:50 +0000, Martin Franklin > <[EMAIL PROTECTED]> wrote: > >>>>>> r="erewr \r\nafjdskl " >>> 'erewr \r\nafjdskl' >>> >>> 2) Unix >>>>>> r="erewr \nafjdskl " >>> 'erewr\nafjdskl' >> why not use string methods strip, rstrip and lstrip >> > > because this removes only the last spaces, >>>> r > 'erewr \r\nafjdskl ' >>>> r.rstrip() > 'erewr \r\nafjdskl' > > I want: > 'erewr\r\nafjdskl' > > or for unix line endings > 'erewr\nafjdskl' >
how about one of these variations print 'erewr \r\nafjdskl '.replace(" ", "") print 'erewr \r\nafjdskl '.strip(" \t") -- http://mail.python.org/mailman/listinfo/python-list