From: Dave Thomas Date: 2001-10-10T06:57:18+09:00 Subject: [ruby-talk:22349] Re: [Newbie] Switching from Perl : suffling Damien WYART writes: > > original = readlines("\n%\n") > > puts original.shuffle > > Sorry for my dumbness, but I find something strange : why are the > "\n%\n" included in the output (this is what I want, but it feels like > it is not asked explicitely) instead of simple "\n" ? Ruby leaves the line terminations on when it reads. We specified a line terminator of "\n%\n", so you get this at the end of every 'line'. You could remove it using something like (untested): EOL = "\n%\n" original = readlines(EOL).collect! {|line| line.chomp(EOL) } Regards Dave