bruce wrote: > hi... > > i'm running into a problem where i'm seeing non-ascii chars in the parsing > i'm doing. in looking through various docs, i can't find functions to > remove/restrict strings to valid ascii chars. > > i'm assuming python has something like > > valid_str = strip(invalid_str) > > where 'strip' removes/strips out the invalid chars... > > any ideas/thoughts/pointers...
If you're able to define the invalid_chars, the most convenient is probably to use the strip() method: >>> a_string = "abcdef" >>> invalid_chars = 'abc' >>> a_string.strip(invalid_chars) 'def' -- http://mail.python.org/mailman/listinfo/python-list