Here’s my code:
string abc = "hello welcome!!";
StringBuilder sb = new StringBuilder();
sb.Append("<td style='padding-left:30px;width:100%'><span style='text-decoration:none;cursor:pointer' id='AnnMsg' target='_top' ><B><nobr>***"<%= i want to pass abc here %>"***</nobr></B></span></td>");
sb.Append("</tr></table>");
These days i would recommend you use the interpolated string(this is available since C# 6) :
If you use the interpolated string it is also still possible to use the @ symbol(verbatim identifier) to escape characters. You can do this by adding the @ in front or behind the $.
Alternatively you could use the + operator like this :
Or you could also use string.Format :