For example I have some random string:
str = \"26723462345\"
And I want to split it in 2 parts after 6-th char. How to do this correctly?>
As a fun answer, how about:
str.split(/(^.{1,6})/)[1..-1]
This works because split returns the capture group matches, in addition to the parts of the string before and after the regular expression.