From: Jacqueline Chenault Date: 2013-01-30T07:09:15+09:00 Subject: Re: ruby array to list --510846a7_43f18422_105 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Robert, try myarray.join(", ") It will take every item in the array and join it using what you put in parentheses. It returns a string, so what you'll really get back is "test1, test3, test4, test5" If you look at the Ruby docs for Arrays you'll find some other useful methods you can call on them. http://www.ruby-doc.org/core-1.9.3/Array.html Jacqueline Chenault Web Developer (http://www.adigitalnative.com) | Actor (http://www.jacquelinechenault.com) @ (http://www.twitter.com/adigitalnative)adigitalnative | adigitalnative@gmail.com (mailto:adigitalnative@gmail.com) | Facebook (http://www.facebook.com/jchenaultacts) | 202.489.6128 On Tuesday, January 29, 2013 at 4:53 PM, robert lengu wrote: > Hi > I dont know if i can do this or is there is any way to implement the > logic or i am just being stupid... > > > suppose, if i do this > > p myarray > > it give me > > ["test", "test3", "test4", "test5"] > > but is there any way to make this output like bellow > > test, test3, test4, test5 > I > ?? > any help will be really good .. > > -- > Posted via http://www.ruby-forum.com/. > > --510846a7_43f18422_105 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Robert, try

myarray.join(=22, =22)

<= /div>
It will take every item in the array and join it using what you= put in parentheses. It returns a string, so what you'll really get back = is
=22test1, test3, test4, test5=22

If= you look at the Ruby docs for Arrays you'll find some other useful metho= ds you can call on them.
http://www.ruby-doc.org/core-1.9.3/Array.html=

Jacqueline Chenault
Web Developer =7C Actor
=40= adigitalnative =7C adigitalnative=40gmail.com =7C =46acebook =7C 202.489.6128

=20

On Tuesday, January 29= , 2013 at 4:53 PM, robert lengu wrote:

Hi
I dont know if i ca= n do this or is there is any way to implement the
logic or i am= just being stupid...


suppose, if= i do this

p myarray

it= give me

=5B=22test=22, =22test3=22, =22test4=22= , =22test5=22=5D

but is there any way to make th= is output like bellow

test, test3, test4, test5<= /div>
I
=3F=3F
any help will be really good ..

--
= =20 =20 =20 =20
=20

--510846a7_43f18422_105--