"Lyle Johnson" <ljohnson / resgen.com> wrote in message
news:u8htpr42fua4d8 / corp.supernews.com...
> > I'm calling array.join('\n') and what I'm getting is one string made up
of
> > all the array strings separated by the characters '\' and 'n', rather
than
> a
> > newline character.  Why isn't a newline character the separator?
>
> Escape codes like newline (\n) aren't evaluated when the string is in
single
> quotes. Try putting your separator for join() in double quotes and you
> should get the desired results:
>
>     irb(main):001:0> words = ['this', 'that', 'whatnot']
>     ["this", "that", "whatnot"]
>     irb(main):002:1> puts words.join('\n')
>     this\nthat\nwhatnot
>     nil
>     irb(main):003:1> puts words.join("\n")
>     this
>     that
>     whatnot
>     nil

Ah...hmm...I have the expression inside of a #{} in a string...guess I have
to take that out and go with double-quotes.

Thanks!

    Sean