From: Damir Sigur Date: 2011-03-26T05:28:44+09:00 Subject: How to "find" new lines I am new to ruby, and was trying to make a small code which would check if a string has only new line character in it. At the end I found that a method "inspect" will do the trick. Is that the only way to handle new line characters? How about other special characters, if there is a need to search for them in a text? Code that didn't work: if txtArray[i] <=> "\n" then Code that worked: if txtArray[i].inspect <=> "\n" then Thanks for all comments. -- Posted via http://www.ruby-forum.com/.