D
Damir Sigur
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 <=> "\n" then
Code that worked:
if txtArray.inspect <=> "\n" then
Thanks for all comments.
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 <=> "\n" then
Code that worked:
if txtArray.inspect <=> "\n" then
Thanks for all comments.