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.
Eg,
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)
3. caught

Also whenever i split into substrings/lines i need to assign it a number and this number has to be in sequence.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.