In PHP, we have a pre defined function nl2br which converts newlines to <br/> tag. Unfortunately we don’t have a function in Ruby similar to nl2br.
We have to create a user defined function.
Example function for nl2br
def nl2br(string) string = string.gsub(/(\r)?\n/, " ") return string end
Thats it. Happy Coding!
Cover Image: Ruby On Rails
Hello. And Bye.
google404
hjgklsjdfhgkjhdfkjghsdkjfgdh
Great, thanks for sharing this article post. Thanks Again. Awesome. Amandy Sayers Herwig
There is clearly a bunch to realize about this. I believe you made certain good points in features also. Anna-Diane Willie Yeo
A person essentially lend a hand to make seriously articles I might state. Maxy Roosevelt Russia
You made some nice points there. I did a search on the theme and found nearly all folks will go along with with your blog. Arabele Igor Gerkman
Rather revealing, looking frontward to coming back. Josi Raynor Kameko
Great delivery. Great arguments. Keep up the good spirit. Amber Warren Coffeng
Thank you for posting. I have the same as you think
Thank you for making me aware of this news.
Great goods by you, man. I actually have understand your stuff previous to and you’re
just too magnificent. I really like what you’ve acquired
here, really like what you’re stating and just how where you say
it. You will make it enjoyable and you still maintain to maintain it sensible.
I can’t wait to see considerably more on your part.
This can be really a terrific website.
My site :: exercise fitness planner stickers
I every time employed to read article in news papers however while i am an end user of web so from now I am just using
net for articles, as a result of web.
Feel free to visit my site … MaritaKShutt
whoah this blog is wonderful i love reading your posts.
Stay up the good work! You already know, many persons are searching round
for this info, you could help them greatly.
Here is my web blog :: chic sparrow nano wallet insert