Better string.translate?

Stowasser Harald stowasser.h at idowa.de
Wed Mar 14 08:44:42 EST 2001


Hello,
i am very new in Python. I don't know how i can do this better:

_deltable=string.maketrans('.,:;-_?!.=()´[]{}\'\"\r\n\f\t\v','
')
ret = string.translate(s,_deltable)

This works fine, but i need a 'anti-maketrans'.
I want to define what characters NOT to change in a space-character.

How can i do this in Python?





More information about the Python-list mailing list