Given the ruby code:
\"aaaa\\nbbbb\\n\\n\".split(/\\n/)
This outputs:
[\"aaaa\", \"bbbb\"]
I would like the
You can supply a negative argument for the second parameter of split to avoid stripping trailing empty strings;
"aaaa\nbbbb\n\n".split(/\n/, -1)
Note that this will give you one extra empty string compared to what you want.