On Mon, Oct 31, 2011 at 4:08 PM, Dave Angel <d...@davea.name> wrote: Yes. Actually, you don't even need the split() -- you can pass an optional deletechars parameter to translate().
On Oct 31, 5:52 pm, Ian Kelly <ian.g.ke...@gmail.com> wrote: > That sounds overly complicated and error-prone. Not really. > For instance, split() will split on vertical tab, > which is not one of the characters the OP wanted. That's just the default behavior. You can explicitly specify the separator to split on. But it's probably more efficient to just use translate with deletechars. > I would probably use a regular expression for this. I use 'em all the time, but not for stuff this simple. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list