Ruby Newbee wrote:

> Oh sorry I have found that.
> need to convert the arguments to an array.
> 
> "Hello, %s %s" %(["Matz!","again"])
> => "Hello, Matz! again"
> 
> 
> 
> On Mon, Dec 14, 2009 at 3:03 PM, Ruby Newbee <rubynewbee / gmail.com>
> wrote:
> > Hi,
> > 
> > In python this is right:
> > 
> >>>> "Hello, %s %s" %("Matz!","again")
> > 'Hello, Matz! again'
> > 
> > 
> > But in ruby it will get wrong:
> > 
> > "Hello, %s %s" %("Matz!","again")
> > SyntaxError: (irb):39: syntax error, unexpected ',', expecting ')'
> > "Hello, %s %s" %("Matz!","again")
> >             ^
> >    from /usr/bin/irb:12:in `<main>'
> > 
> > 
> > 
> > So what's the correct syntax for this case?
> > Thanks.
> > 

"Hello, %s %s" % ["Matz!", "again"]
    ==>"Hello, Matz! again"
"Hello, %s %s" % %w(Matz! again)
    ==>"Hello, Matz! again"

--