Split string into multiple lines
- by RememberME
I have a long string of comments that I'd like to split into multiple lines.
It's currently displayed as <%= Html.Encode(item.important_notes) %>
I've played with using .Substring to split it, but can't figure out how to prevent it from splitting in the middle of a word. Instead of characters 1-100 on line 1 and 101-200 on line 2, I'd like to do something like character 1 through the last space before character 100 on line one. That character through the last space before the next 100 characters on line 2, etc.
What is the best way to do this?
EDIT: using ASP.NET-MVC