From: 7stud -- Date: 2011-03-26T07:35:24+09:00 Subject: Re: How to "find" new lines Actually, that solution does not work, as you can see here: strings = ["hello\n", "\n"] strings.each do |str| if str =~ /\n/ puts "yes -- #{str}" end end --output:-- yes -- hello yes -- You can use == to test whether a string contains only a newline: strings = ["hello\n", "\n"] strings.each do |str| if str == "\n" puts "yes -->#{str}<--" end end --output:-- yes --> <-- -- Posted via http://www.ruby-forum.com/.