Remove no-printable characters in string

Paul Rubin http
Wed Dec 3 11:53:35 CET 2003

pascal.parent at (Pascal) writes:
> What's the best way to delete or replace no-printable characters in a string.
> i.e.: "\x08toto\x00titi" -> "tototiti" or " toto titi"

Fastest way is probably with the built-in string.translate operation.

More information about the Python-list mailing list