What's the Python2.5 equivalent of Python2.6 translate with None as first param?

Posted by Thierry Lam on Stack Overflow See other posts from Stack Overflow or by Thierry Lam
Published on 2010-03-02T19:03:18Z Indexed on 2010/03/27 1:23 UTC
Read the original article Hit count: 240

Filed under:

In Python 2.6, I can run the following fine to strip out chars like -()

'(123) 456-7890'.translate(None, '-(), ')

Python2.5 translate does not accept None, how can I do the above in 2.5?

© Stack Overflow or respective owner

Related posts about python