From: Armin Roehrl Date: 2001-08-18T05:46:30+09:00 Subject: [ruby-talk:19958] Re: reading file line by line > Im reading in a file through a block then a file.each_line {|line| > Then i need to make sure that the \n\r's are striped. At the moment im > doing > line = line.gsub(/[\n\r]/, ""). Was wondering if there was a better way to > do it. what about: line.chomp! http://www.rubycentral.com/ref/ref_c_string.html#chomp_oh alternatively, you might also want to look at chop. -- Armin. ----------------------------------------------- Armin Roehrl, http://www.approximity.com "The best way to predict the future is to invent it." --Alan Kay