title: Remove punctuation at beginning and end of a string
body: <p>I have a string and I want to remove all the punctuation from the beginning and the end of it only, but not the middle. </p>
  
  <p>I have wrote a code to remove the punctuation from the first and last character of a string only, which is clearly very inefficient and useless if a string has 2 or more punctuations at the end.</p>
  
  <p>Here is an example:</p>
  
  <pre><code>{ Hello ""I am:: a Str-ing!! }
  </code></pre>
  
  <p>Desired output</p>
  
  <pre><code>{ Hello I am a Str-ing }
  </code></pre>
  
  <p>Are there any functions that I could use? Thanks.</p>
  
  <p>This is what I've done so far. I'm actually editing the string in a linked-list </p>
  
  <pre><code>if(ispunct(removeend-&gt;string[(strlen(removeend-&gt;string))-1]) != 0) { 
      removeend-&gt;string[(strlen(removeend-&gt;string))-1] = '\0'; 
  } 
  else {} 
  </code></pre>