Re: is it bug? for



On 6/30/07, Axel Etzold <AEtzold@xxxxxx> wrote:
> Well, yours isn't correct. On 1.8:
>
> >> "a\nb\nc\n".to_a
> => ["a\n", "b\n", "c\n"]
>
> The code you mentioned is just:
>
> ["a\nb\nc\n"]
Ok, but do you know that that's what the OP wanted ?
Best regards,

I can only assume so seeing as this is the behaviour of String#to_a in
1.8 and it does not exist in 1.9

But no, he'd need to answer that. Typically if you want to do that
kind of manipulation, Array() is better, anyhow.

Array([1,2,3])
=> [1, 2, 3]
Array("foo")
=> ["foo"]

.



Relevant Pages

  • Re: how to solve a special JRuby and Java syntax conflict?
    ... following Paul Smith's suggestion to Axel Etzold, ... with Carl Leiby-2 giving the following elegant way of doing this: ... If I understand your problem correctly, you are in a bit of ruby code ... You can just define the 2d array like you ...
    (comp.lang.ruby)
  • Re: Array checking ????????????????????
    ... Betreff: Re: Array checking ???????????????????? ... On Thu, 15 Nov 2007, Axel Etzold wrote: ... Intro to Rails, London, UK, December 3-6 ...
    (comp.lang.ruby)
  • Re: CGI unescapeHTML to escape code &# 8211;
    ... Axel Etzold wrote: ... have a look at htmlentites. ... Maybe you can re-escape its results using CGI.escape, ... Best regards, ...
    (comp.lang.ruby)
  • Re: How to catch STDIO STREAM?
    ... is there a way to convert it into string? ... Axel Etzold wrote: ... How to catch STDIO STREAM? ... Best regards, ...
    (comp.lang.ruby)