Stripping new lines from strings?

Simon Brunning SBrunning at trisystems.co.uk
Thu Aug 24 07:38:48 EDT 2000


> From:	Matthew Schinckel [SMTP:matt at null.net]
> What about using re:
> 
> re.sub("\n$", '', str)
> 
Yup, that'll do it. It would still be nice if string.strip had an optional
2nd argument, though. Given that string.split has an analogous (S?) 2nd
argument, it would seem reasonable. Doesn't sound like a complex change,
either.

2.1 perhaps? How would I go about making a suggestion that this be included?

I'd-patch-it-myself-if-only-I-know-C-ly-y'rs,
Simon Brunning
TriSystems Ltd.
sbrunning at trisystems.co.uk




-----------------------------------------------------------------------
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution, or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. TriSystems Ltd. cannot
accept liability for statements made which are clearly the senders own.




More information about the Python-list mailing list