Need to create a string token dynamically base on which method is calling it
<p>This is a minimal code. </p>

<p>I have the string Str which is used by various methods. I want to in getId method be able to do 2 things</p>

<ol>
<li>Assign class="PDP" to it and </li>
<li>Give it a value3</li>
</ol>

<p>So the final string looks like </p>

<p><code>&lt;tr class='PDP' id='{2}'&gt; &lt;td {0}&lt;/td&gt;&lt;td&gt;{1}&lt;/td&gt;&lt;/tr&gt;</code></p>

<p>But please note that I will need different values for class in different methods so some Str will have PDP, another will have PTM etc. Is there a clean way to achieve this .</p>

<pre><code>private const string Str = "&lt;tr&gt;&lt;td &gt;{0}&lt;/td&gt;&lt;td&gt;{1}&lt;/td&gt;&lt;/tr&gt;";

public static string getId()
{
  string  field=string.Format(str, value1,value2, found=true? value3:"");
}
</code></pre>
