Closed ratouney closed 7 years ago
Hello @ratouney
You are looking at the wrong function. You do not want to iterate over your list. You want to join each items of your list into one string.
Does it help?
Well, it did help and it was way easier than i though (I just had to rtfm of Enum.join)... @arkanoryn i'll start with starcraft then !
@ratouney :) NP.
Exercises are made so that you do them in less than 30mn/day, theoretically. :) Can we close the issue?
@arkanoryn
I've done most of the exercise without any problems but now i'm having trouble to understand how I'm supposed to get the values out of the list.
With this syntaxt : Enum.each(list, fn(s) -> IO.puts(", " <> s) end) I'm able to output the items, but i can't manage to get them out of the "loop", and the output shows each one a new line, so I would even have to cut a \n each time.
Now with this one : x = "Hello" x = x <> ", " <> Enum.each(list, fn(s) -> s end) x = x <> "!" It doesn't work either, so i'm either missing something in the functionning of the Enum module or i'm just looking for the wrong idea...
Any chance for a little help ?