Mind blowing Ruby String#split bug?
https://news.ycombinator.com/item?id=8966890Ran 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?
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?