There's got to be an easy way to do this

Michael Ströder michael at stroeder.com
Thu Jul 5 14:21:37 EDT 2001


Emile van Sebille wrote:
> Or (without re):
> print "".join([x for x in '(123)/456-7890' if x in '0123456789'])

I guess this one will be significantly slower for larger
data sets than the re solution because of

  if x in '0123456789'

Ciao, Michael.



More information about the Python-list mailing list