View Single Post
  #7 (permalink)  
Old 03-27-2008, 10:52 PM
shaalini shaalini is offline
D-Web Analyst
 
Join Date: Apr 2007
Posts: 342
shaalini is on a distinguished road
Default Re: Ruby Datastructure

Return multiple values with a method

def showme()
return “Thank”, “you”
end

array = showme
puts array.join(“ “)

showme

if you want the text to be displayed with spaces between words, assign an array to the method and use the join method on the array.
__________________
Shaalini.S
Be the Best of Whatever you are...
Reply With Quote