Deleting characters from a string

Magnus L. Hetland mlh at idt.ntnu.no
Mon Jun 7 00:47:10 CEST 1999


Hrvoje Niksic <hniksic at srce.hr> writes:

> 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>

What do you mean? The example above works...

> 
> :-)

--

  Magnus              Making no sound / Yet smouldering with passion
  Lie          The firefly is still sadder / Than the moaning insect
  Hetland                                       : Minamoto Shigeyuki




More information about the Python-list mailing list