c# - put a <br /> tag after some text -


i have variable str having text. show text on ui. have condition, suppose variable having 5oo words, need put
tag after every 50 words.

how can that?

below c# code through sending mail html

emailbody += " <tr>"; emailbody += " <td align='left' valign='top' nowrap><span class=style17>purpose of     travel</span></td>"; emailbody += "<td align='center' valign='top'>:</td>"; emailbody += " <td align='left' valign='top'><span class=style17>&nbsp;&nbsp;" + textbox1.text +     "</span></td>"; emailbody += " <td>&nbsp;</td>"; emailbody += "  <td align='left' nowrap'><span class=style17>advance</span></td>"; emailbody += " <td align='center'>:</td>"; emailbody += "<td align='left' nowrap><span class=style17>"+textbox2.text+"</td>"; emailbody += " </tr>"; 

i need the solution mt textbox1.text

if using c#, can :

    public string splitline(string input)     {         var wordlist = input.split(' ');         var sb = new stringbuilder();         (int index = 0; index < wordlist.length; index++)         {             if(index % 50 == 0 && index > 0)                 sb.append("<br/>" + wordlist[index]);             else                 sb.append(wordlist[index] + ' ');         }         return sb.tostring();     } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -