title: Text parsing, conditional text
body: <p>I have a text template with placehoders that I parse in order to replace placeholders 
  with real values.</p>
  
  <p>Text Template:</p>
  
  <pre><code>Name:%name%
  Age:%age%
  </code></pre>
  
  <p>I use StringBuilder.Replace() to replace placeholders</p>
  
  <pre><code>sb.Replace("%name%", Person.Name);
  </code></pre>
  
  <p>Now I want to make more advanced algorithm. Some lines of code are conditional. They
  have to be either removed completely of kept.</p>
  
  <p>Text Template</p>
  
  <pre><code>Name:%Name%
  Age:%age%
  Employer:%employer%
  </code></pre>
  
  <p>The line Employer should appear only when person is employed (controlled by boolean variable Person.IsEmployed).</p>
  
  <p><strong>UPDATE:</strong> I could use open/close tags. How can find text between string A and B?
  Can I use Regex? How?</p>