From: Glen Holcomb Date: 2008-08-16T07:28:28+09:00 Subject: Re: im new... so can i have some help ------=_Part_140744_8252328.1218839485609 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Fri, Aug 15, 2008 at 4:21 PM, Daniel Kindler wrote: > Daniel Kindler wrote: > > ok this is what i wrote so far > > > > > > > > array = [] > > num = gets.to_i > > while num != 000 > > num = gets.to_i > > array << num > > array.sort > > end > > > > > > > > > > > > why wont if list out the numbers? > > nvm i relized i didnt add the "puts" > but it comes out like this > > > 2 > 5 > 6 > 8 > 9 > > > > > how do i make it so its in one line? > -- > Posted via http://www.ruby-forum.com/. > > If you want the array data as a string (i.e. one line) you can use the join method: puts array.join(' ') would print the numbers in the array separated by spaces puts array.join(',') would separate the elements with a comma You can separate them with whatever you want, it can even be multiple characters. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) ------=_Part_140744_8252328.1218839485609--