Converstion

placid Bulkan at gmail.com
Thu Apr 27 21:09:23 EDT 2006


Chris wrote:
> In a program I'm writing I have a problem where a bit of text sent over
> a network arrives at my server. If the person who sent the text made a
> mistake typing the word and pressed backspace the backspace code is
> included in the word for example hello is hel\x08lo. The \x08 is the
> backspace key. How do I convert this string to a normal string (without
> the \x08). If I print it to screen it appears normal, "hello" but if I
> store it in a list it appears as hel\x08lo.

inefficient way, use split ("\x08") then recombine the splitted
elements, or iterate thorough the list and create a new string, but
dont add the backspace character




More information about the Python-list mailing list