Robert Klemme
4/12/2005 7:17:00 AM
"Steve V" <ruby@digitalnothing.com> schrieb im Newsbeitrag
news:LDEHKBBOEMIJKHKBOFNFCEHPNBAA.ruby@digitalnothing.com...
> How can I force \n in my strings to be *only* a newline character and
not a
> carriage return/newline combination on Windows?
It's always just a newline in strings. I guess you mean you want the \n
in a file written:
09:14:10 [temp]: irb
irb(main):001:0> File.open("x","wb") {|io| io.puts "foo\nbar"}
=> nil
irb(main):002:0> exit
09:15:51 [temp]: od -t c x
0000000 f o o \n b a r \n
0000010
09:15:56 [temp]:
Kind regards
robert