If I\'ve got a textarea like this:
Is there any way, using JavaScript, t
I'm assuming that you know the dimensions of the text area (if not, you can probably just get them from the DOM).
Use this to split the string. Go to the xth char (in your example the 5th), and see if the next char is a space. If so (or if there are no spaces in the preceding segment), this is where you split. Otherwise, you find the preceding space and split there.
Wrap this in a function and you could add in some recursion to find the nth line.