title: how to replace last comma with "and"
body: <p>I want to replace <em>last comma</em> with <code>"and"</code> in my C# sample and full stop at the end.</p>
  
  <p>I am trying the below code:</p>
  
  <pre><code>result = (result.LastIndexOf(",") == result.Length - 2) 
          ? result.Remove(result.LastIndexOf(","), 2) 
          : result;
  
  result += ".";
  </code></pre>
  
  <p>Where my current output comes like this:</p>
  
  <blockquote>
    <p>abc, def, ghi.</p>
  </blockquote>
  
  <p>Expected:</p>
  
  <blockquote>
    <blockquote>
      <p>abc, def and ghi.</p>
    </blockquote>
  </blockquote>
  
  <p>I need to replace the last coma with <code>and</code>. I tried using <code>replace</code> but it didn't work.</p>