use % for format printing : String format « String « Ruby






use % for format printing


puts  "%s, %s!" % [ "Hello", "Matz" ]

 








Related examples in the same category

1.Substituting Variables Into an Existing String
2.Replace string with float
3.Changing the Case of a String
4.Center, left justify and right justify string