From: Alan Moore Date: 2001-10-23T22:05:29+09:00 Subject: [ruby-talk:23046] Re: chop and chomp Guy Decoux wrote: >A> separators used by different OS's. What I'm wondering is, >A> why doesn't String#chomp work the same way? > > chomp([rs]) > chomp!([rs]) > > Chops off the line ending of the string, which is specified by the > rs. The default value of the rs is the value of the variable $/. > > You can specify `rs' for #chomp, $/ is just the default value I know that. What I'm saying is that I shouldn't have to specify it--chomp should recognize any of "\r\n", "\n" or "\r" as a line ending and chop it off. Just trying to match the value of $/ is too clumsy when the line separator can change from one document to the next, or even from one para- graph to the next. Ruby's chop method is much more useful than Perl's because of that one little enhancement. Why not enhance chomp as well? --Alan