From: "Paulo Köch" Date: 2006-12-28T05:38:11+09:00 Subject: Re: Handling of arbitrary length arrays in arguments to printf builtin I guess you'll have to select the elements from the array. AFAIK, the Array#* in only used to pack and unpack arrays into argument lists (and other kinds of lists). For example: def multiple_returns 1, 2, 3, 4 end a = multiple_returns # a=1 a, b = multiple_returns # a=1, b = 2 a, *b = multiple_returns # a=1, b = [2,3,4] Hope you'll get less n00b =P cheers! On 12/27/06, Jason Mayer wrote: > On 12/27/06, Timothy Hunter wrote: > > > > Welcome to Ruby! > > > > Use the "*" (splat) operator to turn the array into a list of arguments. > > > > printf "%s %s", *@params > > > > The unary asterisk is often called the "unary unarray" operator because > > it has this effect on an array. > > > Neat! How would you use that to return "bar stuff" with the following? > > @params = ["foo", "bar", "stuff"] > print @params.inspect > printf "%s %s", *@params > > I'm not sure that Ri Array#* is quite what I meant to look for. > >