Micro-PEP: str.translate(None) to mean identity translation
- From: bokr@xxxxxx (Bengt Richter)
- Date: Sat, 30 Apr 2005 01:37:20 GMT
Just thought None as the first argument would be both handy and mnemonic,
signifying no translation, but allowing easy expression of deleting characters,
e.g.,
s = s.translate(None, 'badcharshere')
Regards,
Bengt Richter
.
- Follow-Ups:
- Re: Micro-PEP: str.translate(None) to mean identity translation
- From: M.E.Farmer
- Re: Micro-PEP: str.translate(None) to mean identity translation
- From: Michael Spencer
- Re: Micro-PEP: str.translate(None) to mean identity translation
- Prev by Date: Re: Python Challenge ahead [NEW] for riddle lovers
- Next by Date: [wxPython] Many wxPanel forms in 1 wxFrame
- Previous by thread: Killing process
- Next by thread: Re: Micro-PEP: str.translate(None) to mean identity translation
- Index(es):
Relevant Pages
|