I am attempting to create a tool that takes an input text and splits it into chunks of text at a certain # of characters. However, I need to make sure it does not split the
you could use a simple function like this:
function split(string) {
for(i=154; i>=0; i--) {
if(string.charAt(i) == " ") {
var newString1 = string.slice(0, i);
var newString2 = string.slice(i);
}
}
}
Instead of assigning to separate strings you can always put them into an array if you'd like as well.