title: string replace using Linq in c#
body: <pre><code>
  public class Abbreviation
  {
      public string ShortName { get; set; }
      public string LongName { get; set; }
  }
  </code></pre>
  
  <p>I have a list of Abbreviation objects like this:</p>
  
  <pre><code>
  List abbreviations = new List();
  abbreviations.add(new Abbreviation() {ShortName = "exp.", LongName = "expression"});
  abbreviations.add(new Abbreviation() {ShortName = "para.", LongName = "paragraph"});
  abbreviations.add(new Abbreviation() {ShortName = "ans.", LongName = "answer"});
  
  string test = "this is a test exp. in a para. contains ans. for a question";
  
  string result = test.Replace("exp.", "expression")
  ...
  </code></pre>
  
  <p>I expect the result to be:
  "this is a test expression in a paragraph contains answer for a question"</p>
  
  <p>Currently I am doing:</p>
  
  <pre><code>
  foreach (Abbreviation abbreviation in abbreviations)
  {
      test = test.Replace(abbreviation.ShortName, abbreviation.LongName);
  }
  result = test;
  </code></pre>
  
  <p>Wondering if there is a better way using a combination of Linq and Regex.</p>