WordWrap function in c#
Today I worked on a piece of code at RemoteX and needed a pretty simple word wrapping function in C# which:
1) breaks between words, if possible
2) breaks words, if they’re too long to fit on one line
I used the almighty code snippet resource but couldn’t find a quick fix for my need without digging further into the different solutions, so here is my contribution to the long list of word-wrapping functions posted around the web.
Just like I tried to use several of the code snippets I found on the web, you are free to use mine.
I take no responsibility for any bugs you may find in this code snippet may include. Please let the tests guide you!
https://github.com/anderssonjohan/snippets/blob/master/wordwrap/WordWrapTests.cs