After having asked this question in the DB section and being adived to ask it here, here is my problem:
I have the problem, that I have a long text that is being read from a database. The text itself is just a one liner. The problem is that it needs to be broken at exactly 80 chars even when in the middle of a word.
HTML or other languages will make the line break if the next word doesn’t fit in the remaining chars and that is not what I want. The pages are done in jsf.
For example:
textarea= cols: 8 rows: 3
input= break these texts
normal:
break
these
texts
what I need:
break th
ese text
s
Any ideas on how I can do this?
you can use the below function just pass the string (you want to brake after every 80 char) to the function
NOTE : this function will replace all the line break and insert a
<br>after every 80 charWorking DEMO