title: c# Replace string in a property of a class using linq not working
body: <p>I am trying to find a specific string in a property of a class and replace it with another string if found. I tried various methods using Linq but I am not able to replace it. In debug mode, when I monitor the object again, the replace command hasn't worked. Please help. Including a sample example below.</p>
  
  <pre><code>class Tryreplace
  {
      public string ClubName { get; set; }
  }
  
  List&lt;Tryreplace&gt; tryreplaces = new List&lt;Tryreplace&gt;();
  
  Tryreplace tryreplace = new Tryreplace { ClubName = "Manchester United FC" };
  
  Tryreplace tryreplace2 = new Tryreplace { ClubName = "Arsenal FC" };
  
  tryreplaces.Add(tryreplace);
  
  tryreplaces.Add(tryreplace2);
  </code></pre>
  
  <p>Tried 2 ways below, both didn't work...</p>
  
  <pre><code>tryreplaces.ForEach(x =&gt; x.ClubName.Replace("Manchester", "Newcastle"));
  
  
  
  List&lt;Tryreplace&gt; tryreplaces2 = tryreplaces.Select(x =&gt; { x.ClubName.Replace("Manchester", "Newcastle"); return x; }).ToList();
  </code></pre>
  
  <p>After both, I only see Manchester and not Newcastle.</p>
  
  <p>I would like to see replaced string Newcastle in the objects and not Manchester. Please help!</p>