From: Jari Williamsson Date: 2007-11-13T03:24:36+09:00 Subject: Re: Format string Jon Stenqvist wrote: > In other language there is often a function for format a string. > Format("Hello %s",["Stonebreaker"]) > > I'm would like to use this for localization strings so the "#{var}" > would not be a good chooise. I'm a bit curious why the #{} wouldn't fit your needs, since you can put just about any method return within the curly brackets. sprintf and such are just needed when you need strict formatting, and your example doesn't. For example: i = 1 puts "Text is #{["Test 1", "Test 2"][i]}" Produces: "Text is Test 2" Best regards, Jari Williamsson