I have some sample code where I used string.Format but after reading about benchmark performances by other people I believe that it may be better to do multiple appends by a StringBuilder
Here is the scenario:
In my gridView, I have a function called before a databind. The function looks like such:
public string getColumnText(String myParam)
{
StringBuilder sb = new StringBuilder();
return sb.Append(string.Format("<a href='javascript:Global.someFunction(\"{0}\");'>{1}</a>", myParam).ToString();
}
Is this a better alternative?
StringBuilder sb = new StringBuilder();
sb.Append("<a href = 'javascript:Global.someFunction(\"");
sb.Append(myParam"); etc...
Let's assume that this function will be called 10,000 times.
gridview.databind()is called so implying that 10K cooresponds to the number of entries in my gridView \$\endgroup\$