stripping out unwanted characters in string

dsavitsk dsavitsk at e-coli.net
Mon Jun 5 00:33:37 EDT 2000


>>> str = string.replace(str, 'unwanted', '')
or
>>> str = string.join(string.split(str, 'unwanted'), '')

"Jerry F. Davis" <jfdecd at execpc.com> wrote in message
news:393b1f58$0$95987 at news.execpc.com...
> Howdy:
>
> I have a string that has some unwanted characters in it.
> Octal 240 for instance.
>
> I want to actually strip them out of my string.
>
> I have looked at string.replace, but can't seem to figure out how to do
> this.
>
> Thanks in advance.
>
> Jerry





More information about the Python-list mailing list