title: How to trim characters from certain patterned words in string?
body: <p>Given the following string:</p>
  
  <pre><code>string s = "I need drop the 1 from the end of AAAAAAAA1 and BBBBBBBB1"
  </code></pre>
  
  <p>How can I trim the "1" from any 8 character string that ends in a 1? I got so far as to find a working Regex pattern that finds these strings, and I'm guessing I could use a TrimEnd to remove the "1", but how I do I modify the string itself?</p>
  
  <pre><code>Regex regex = new Regex("\\w{8}1");
  
  foreach (Match match in regex.Matches(s))
  {
      MessageBox.Show(match.Value.TrimEnd('1'));
  }
  </code></pre>
  
  <p>The result I'm looking for would be "I need drop the 1 from the end of AAAAAAAA and BBBBBBBB"</p>