Array of Chars to String
Bengt Richter
bokr at oz.net
Thu Apr 21 13:32:27 EDT 2005
On Thu, 21 Apr 2005 07:34:09 +0200, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <martin at v.loewis.de> wrote:
>James Stroud wrote:
>> astr = "Bob Carol Ted Alice"
>> letters = "adB"
>
>Apparently nobody has proposed this yet:
>
>>>> filter(letters.__contains__, astr)
>'Bad'
>>>> filter(set(letters).__contains__, astr)
>'Bad'
>
Baaad ;-)
But since I'm playing the other side of the table for
the moment, isn't filter to be deprecated?
Regards,
Bengt Richter
More information about the Python-list
mailing list