print "welcome back!" in ruby

To print "welcome back!" in Ruby, you can use the puts keyword followed by the text you want to print, like this:

main.rb
puts "welcome back!"
21 chars
2 lines

Alternatively, you can use print in place of puts:

main.rb
print "welcome back!"
22 chars
2 lines

Both puts and print will output the text to the console followed by a newline character at the end. The difference between the two is that puts adds an extra newline character, while print does not.

related categories

gistlibby LogSnag