i have a textarea where a user can enter free flow text.I want to seperate out lines/occurences in my java class based on the below conditions:
Unless the user presses the enter key i want to get substrings(texts) of 15 characters each or else whenever the user presses enter i want to seperate that part out and start again counting till 15 to get a new splittted substring till i reach the end of the free flow text/string.
If user enters:
Heloo i want
enter key to be caught.
So i want this text to be seperated into the below substrings:
1. Hello i want(assuming the user pressed enter key at this point)
2. enter key to be(as the limit is 15)
Also whenever i split into substrings/lines i need to assign it a number and this number has to be in sequence.