title: Variable in the dynamic string in C#
body: <p>I have a module to send message with the SMS. I can put the variable in the string if the message is a static, but the user request the message can be changed whatever their want.  </p>
  
  <p>I created this variable </p>
  
  <ol>
  <li>CompanyName </li>
  <li>CustomerName  </li>
  <li>BillNumber  </li>
  <li>Payment  </li>
  </ol>
  
  <p>Example :</p>
  
  <blockquote>
    <p>From <strong>{Company}</strong>. Hi Mr/Mrs <strong>{CustomerName}</strong>, your bill number is
    <strong>{BillNumber}</strong> with a total payment of <strong>{Payment}</strong>. We want to inform you
    the items has been completed and ready for collection.</p>
  </blockquote>
  
  <p>My current code is work for static message,</p>
  
  <pre><code>string messageSms = "From " +Company+ ". Hi Mr/Mrs "+{CustomerName}+", your bill number is "+{BillNumber}+" with a total payment of "+{Payment}+". We want to inform you the items has been completed and ready for collection.";
  </code></pre>
  
  <p>But how can be done with dynamic message? How can I detect the variable in the string and set the data on the variable?</p>
  
  <p>I also following with this <a href="https://stackoverflow.com/questions/7227413/c-sharp-variables-in-strings">article</a> but not help so much.</p>