So I have a string that I need to split into an array, for example:
"1234567890"
I need to be able to split it like:
"1234567890".break(2) = ["12345", "67890"]
and:
"1234567890".break(3) = ["123", "456","7890"]
So I don't want it to split it into an array of equal parts, I want to split the string into an array of length n
. How do you think I would go about doing this?
No, its not this: regex - Split large string in n-size chunks in JavaScript