Discussion

Mind blowing Ruby String#split bug?

Ran into a weird bug because of this:

> x = "a"

=> "a"

> x.split('*')

=> ["", "a"]

Expected => ["", "a", ""] or ["a"]

It feels bizarre. Anyone has an explanation for this?

4 points sm_sohan 11 years ago 4 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton