Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Array.join for nested arrays
freeunli
6/28/2007 6:37:00 PM
Doing
arr = [1, [2, [3, 4], 5], 6]
arr.join(',')
in Ruby 1.8.6 produces the following string:
1,2,3,4,5,6
Looking at the docs (e.g.
http://www.noobkit.com/ruby-...
),
Array.join should work as following:
"Returns a string created by converting each element of the array to a
string, separated by sep."
Doing the following:
arr.each do |e|
However, this is not what I expected - I would have expected:
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Array.join for nested arrays
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password