There is a message for the forum that the user sent. The field for the message on width and height is limited. How to break a message so that it fit the width of this field and, if it does not fit in height, then put an ellipsis at the end of the message? So that half of the word was on one line, and the other half on the second can NOT be split.
JavaScript and C # implementation is desirable.