Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference in String#split behavior #2565

Closed
dazuma opened this issue Jan 9, 2022 · 2 comments
Closed

Difference in String#split behavior #2565

dazuma opened this issue Jan 9, 2022 · 2 comments
Assignees
Milestone

Comments

@dazuma
Copy link
Contributor

dazuma commented Jan 9, 2022

String#split behaves differently from MRI in certain cases.

" ".split(" ")  # or equivalently, " ".split

In TruffleRuby 21.3.0, this yields [" "].
In MRI (both 2.7.5 and 3.1.0 tested), this yields [].

@eregon
Copy link
Member

eregon commented Jan 10, 2022

Indeed, thanks for the report (" " as argument is special and awk-like splitting, same as no arg).
@bjfish Could you fix it?

@bjfish
Copy link
Contributor

bjfish commented Jan 13, 2022

@dazuma This is now fixed at 6dd971c. Thanks!

@bjfish bjfish closed this as completed Jan 13, 2022
@bjfish bjfish added this to the 22.1.0 milestone Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants