From: 7stud -- Date: 2007-11-13T03:37:12+09:00 Subject: Re: Format string Jon Stenqvist wrote: > >I'm would like to use this for localization strings > What does that mean? > In other language there is often a function for format a string. > Format("Hello %s",["Stonebreaker"]) > str = "Hello %s" % "Stonebreaker" puts str --output:-- Hello Stonebreaker #------------- names = ["Stonebreaker", "world"] for name in names: puts "Hello %s" % name end --output:-- Hello Stonebreaker Hello world #--------------- names = ["Stonebreaker", "world"] for name in names: puts "Hello #{name}" end --output:-- Hello Stonebreaker Hello world -- Posted via http://www.ruby-forum.com/.