I have a string of length N and I want to split it into equal parts of length L (assuming the last part might be shorter).
N
L
What I came up with
What about this?
string.scan(/.{,#{L}}/)