stripping unwanted chars from string

bruno at modulix onurb at xiludom.gro
Thu May 4 04:22:04 EDT 2006


Edward Elliott wrote:
> Bryan wrote:
> 
>> >>> keepchars = set(string.letters + string.digits + '-.')
> 
> 
> Now that looks a lot better.  Just don't forget the underscore. :)
> 
You may also want to have a look at string.translate() and
string.maketrans()

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list