From: Robert Dober Date: 2009-08-19T04:46:55+09:00 Subject: Re: fromdos dos2unix in ruby On Tue, Aug 18, 2009 at 7:19 PM, Xavier Noria wrote: > 2009/8/18 Robert Dober : > >> If performance can be an issue we could use File#each with 10.chr as a seperator >> >>     in.each 10.chr do | line | >>         out.print line.sub( /\r\n\z/, 10.chr ) >>     end > > Just for the record... in Ruby "\n" == 10.chr in all platforms. I find > "\n" to be more obvious. > I wanted to point out the subtle bug because I thought it useful. But I hate backslashes and use 10.chr often, this however is not good practice, because it is unconventional, it is just me ;). In the infinitesimal hope that 10.chr is useful for some folks anyway. Cheers Robert > -- module Kernel alias_method :ë, :lambda end