Deleting characters from a string

Hrvoje Niksic hniksic at srce.hr
Sat Jun 5 21:56:05 CEST 1999


mlh at idt.ntnu.no (Magnus L. Hetland) writes:

> result = ""
> for char in host:
>     if char not in ' "':
>         result = result+char
> 
> host = result
> 
> What!? To me that's more elegant... <wink>

To me it would be if Python actually had chars.  <handshake>

:-)




More information about the Python-list mailing list