title: Match and replace first and last character in string
body: <p>I would like to remove <code>%</code> characters from the start and the end of a string. For example:</p>
  
  <pre><code>string s = "%hello%world%";
  </code></pre>
  
  <p>Desired result: <code>hello%world</code>.</p>
  
  <p>I know that I can fix this with some if cases combined with <code>StartsWith()</code>, <code>EndsWith()</code> etc. But I'm looking for a cleaner solution. </p>
  
  <p>I suppose regexp is the way to go here, and that's where I need your help.</p>