Stef Mientki wrote:
hello,

Is there a function to remove escape characters from a string ?
(preferable all escape characters except "\n").

thanks,
Stef


import string

WANTED = string.printable[:-5] + "\n"

def descape(s, w=WANTED):
  return "".join(c for c in s if c in w)


James


--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA  90095

http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to