From: Cheyne Li Date: 2009-05-12T04:47:10+09:00 Subject: Re: question to write \4 into file 7stud -- wrote: > Cheyne Li wrote: >> Hi there, >> >> I have problem with writng "\4" into a file, for example, I want to >> write a string "aaa\4024_folder\mm" into a file test.cfg. But once the >> string wrote into file, it is "aaa024_folder\mm". So, i do this, >> >> string="aaa\4024_folder\mm" >> string=string.sub(/\\4/,"\\4") the result is the same. >> >> I tried string=string.sub(/\\4/,"\\4"), the result is showed a square >> >> Any one has any idea to solve the problem? Thank you in advance. > > Use single quotes around your string? I tried '\4' '\\4' not luck at all -- Posted via http://www.ruby-forum.com/.