"".split(//,2) different between 1.6 and 1.8

A

Aron Griffis

I've just noticed the following. When using Ruby 1.6, I get the
following String.split behavior:

irb(main):001:0> "".split(//,2)
[""]

And when using Ruby 1.8, I get the following instead:

irb(main):007:0> "".split(//,2)
=> []

Is this intentional?

Thanks,
Aron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top