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?

--
Posted via http://www.ruby-forum.com/.