Hey guys, I was wondering if any of you has the situation of displaying a text in a label?? sure you did. but imagine the text is tooooo long that it's displayed in a long line, Now if you put it in the label it will be displayed in a long line too, to solve this problem there is a lot of solutions you will find if you google it. you can use a textbox and give it the look of a label and set the wrap property to true this will do the trick. but what if you have a devil user or actually " QE Teammate ", and the text he entered is continuous as it was one word in this case it will not be wrapped. so here is a littel extension string helper method that warps the string into lines of length given as a parameter.
The idea here is to devide the string into lines and put a line break tag at the end of the line.
Ofcourse it has some drawback such as the last word of the line might be splitted.but you can put "-" or something like this at the end of the line.
Hope this is helpfu, The source code is attached.
Beckham