gjhames: > What's the better way to do it? Better is a relative term. If with better you mean "faster" (in some circumstances), then the translate method is your friend, as you can see its second argument are the chars to be removed. As first argument you can use something like: "".join(map(chr, xrange(256))) If your strings are unicode you will need something different (a dict with Null values for the key chars you want to remove).
Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list