print one word three times, then add or append more text with + : multiply strings « String « Ruby






print one word three times, then add or append more text with +


puts "Hello, " * 3 + "Matz!"

 

Related examples in the same category

1.What if you want to print out a line of text three times?
2.you can multiply strings
3.You cannot multiply two strings