If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

The way the function works:
The function always returns an Array with a length of 2 elements.
The given argument is the maxium string-length to allow for the the first element.
The second element is the remaining string that gets cut-off by the first element.

When making these functions it is a good idea to test them with a very large array (like 100,000 in length, but be sure not to freeze your computer!). But to track how long it takes, take the time before and after and subtract the two.

Making changes like the ones I did make it more efficient. Instead of continually checking array lengths it has a variable to store that value and a it is incremented each time that the array is added to so it doesnt have to. Making lots of changes like this and adding more variables often increases efficency (one might at first expect the opposite).