What if you want to print out a line of text three times? : multiply strings « String « Ruby






What if you want to print out a line of text three times?


puts "Hello, Matz! " * 3

 

Related examples in the same category

1.print one word three times, then add or append more text with +
2.you can multiply strings
3.You cannot multiply two strings