Re: string replace for back slash

2009-02-05 Thread S.Selvam Siva
On Thu, Feb 5, 2009 at 5:59 PM, wrote: > "S.Selvam Siva" wrote: > > I tried to do a string replace as follows, > > > > >>> s="hi & people" > > >>> s.replace("&","\&") > > 'hi \\& people' > > >>> > > > > but i was expecting 'hi \& people'.I dont know ,what is something > different > > here with e

string replace for back slash

2009-02-05 Thread rdmurray
"S.Selvam Siva" wrote: > I tried to do a string replace as follows, > > >>> s="hi & people" > >>> s.replace("&","\&") > 'hi \\& people' > >>> > > but i was expecting 'hi \& people'.I dont know ,what is something different > here with escape sequence. You are running into the difference between

Re: string replace for back slash

2009-02-05 Thread Chris Rebert
On Thu, Feb 5, 2009 at 3:40 AM, S.Selvam Siva wrote: > Hi all, > > I tried to do a string replace as follows, > s="hi & people" s.replace("&","\&") > 'hi \\& people' > > but i was expecting 'hi \& people'.I dont know ,what is something different > here with escape sequence. The Pyt

string replace for back slash

2009-02-05 Thread S.Selvam Siva
Hi all, I tried to do a string replace as follows, >>> s="hi & people" >>> s.replace("&","\&") 'hi \\& people' >>> but i was expecting 'hi \& people'.I dont know ,what is something different here with escape sequence. -- Yours, S.Selvam -- http://mail.python.org/mailman/listinfo/python-list