Topic: Small question
Hey, What is the Difference between puts and print ?
You are not logged in. Please login or register.
Hey, What is the Difference between puts and print ?
NEVER use puts in a rails app it sends output to the console which is fine in ruby but not on a website. print is fine as far as I know
The difference between puts and print has to do with how ruby formats it.
Puts has a newline (\n) at the end so one puts followed by another puts will but on different lines, print does not have a new line at the end.
There is a difference, it's small but it's there, it's like saying "" and '' have no difference but they have a VERY significant difference especially if your using #{} to print out variales.
Thank you all for your reply:-)
Last edited by jimmybrion (2013-04-13 05:35:39)
Hosting provided by aTech Media