c# - Append string in another string -


this question has answer here:

i have string a="<tr>i'm working in c#<tr/> abcdefghjiklmnopqr ii oo yy uu hh gg rr", , b="<td>finish</td></tr>". need string a

  a="<tr>i'm working in c#<tr/> <td>finish</td></tr> abcdefghjiklmnopqr ii oo yy uu hh gg rr". 

how append string in string above? asked same question earlier wrong. here have find first ">" character , append b in a.

i suppose indexof , substrings

var a="<tr>i'm working in c#<tr/>abcdefghjiklmnopqr ii oo yy uu hh gg rr"; var b="<td>finish</td></tr>";  var insertpoint = a.indexof("<tr/>")+5; var c = a.substring(0,insertpoint) + b + a.substring(insertpoint); 

but if you're trying html generation string concatenation, nightmare. try using razor, or other templating language.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -