title: Deferred template string interpolation
body: <p>In C# there is a string interpolation support like this:</p>
  
  <pre><code>$"Constant with {Value}"
  </code></pre>
  
  <p>which will format this string using in-scope variable <code>Value</code>.</p>
  
  <p>But the following won't compile in current C# syntax.</p>
  
  <p>Say, I have a static <code>Dictionary&lt;string, string&gt;</code> of templates:</p>
  
  <pre><code>templates = new Dictionary&lt;string, string&gt;
  {
      { "Key1", $"{Value1}" },
      { "Key2", $"Constant with {Value2}" }
  }
  </code></pre>
  
  <p>And then on every run of this method I want to fill in the placeholders:</p>
  
  <pre><code>public IDictionary&lt;string, string&gt; FillTemplate(IDictionary&lt;string, string&gt; placeholderValues)
  {
      return templates.ToDictionary(
          t =&gt; t.Key,
          t =&gt; string.FormatByNames(t.Value, placeholderValues));
  }
  </code></pre>
  
  <p>Is it achievable without implementing Regex parsing of those placeholders and then a replace callback on that Regex?
  What are the most performant options that can suit this method as being a hot path?</p>
  
  <p>For example, it is easily achievable in Python:</p>
  
  <pre><code>&gt;&gt;&gt; templates = { "Key1": "{Value1}", "Key2": "Constant with {Value2}" }
  &gt;&gt;&gt; values = { "Value1": "1", "Value2": "example 2" }
  &gt;&gt;&gt; result = dict(((k, v.format(**values)) for k, v in templates.items()))
  &gt;&gt;&gt; result
  {'Key2': 'Constant with example 2', 'Key1': '1'}
  &gt;&gt;&gt; values2 = { "Value1": "another", "Value2": "different" }
  &gt;&gt;&gt; result2 = dict(((k, v.format(**values2)) for k, v in templates.items()))
  &gt;&gt;&gt; result2
  {'Key2': 'Constant with different', 'Key1': 'another'}
  </code></pre>