Deleting specific characters from a string

Asun Friere afriere at yahoo.co.uk
Thu Jul 10 07:51:50 CEST 2003


Behrang Dadsetan <ben at dadsetan.com> wrote in message news:<3F0C8AC3.5010304 at dadsetan.com>...

> 
> def isAcceptableChar(character):
>     return charachter in "@&"
> 
> str = filter(isAcceptableChar, str)
> 
> is going to finally be what I am going to use.

Might 'return character not in "@&"' work better?




More information about the Python-list mailing list