In the <div> I have text. Due to div -width, text is displayed in multiple lines. For instance. following code:
<div>text01 text02 text03 text04 text05 text06 text07 text08 text09 text10 text11 text12</div>
four lines can be shown, for example:
text01 text02 text03 text04 text05 text06 text07 text08 text09 text10 text11 text12
I want to save only the first two lines, and if further lines are present, they should be deleted and replaced with a text line ... as a new (therefore third) text line.
In other words: I want to find the second line break (if any) and replace all the text after this point with a text line containing ...
So, if I have two lines of text, nothing changes:
text text text text text text
But if I have more than two lines as above, I will get this:
text01 text02 text03 text04 text05 text06 ...
Any good advice?
source share