title: Remove spaces and commas at the end and beginning of comma separated string
body: <p>Given that I can get strings like this:</p>
  
  <pre><code>dog, cat, person
  
  ,people, boys, girls, 
  
  people, boys, police ,
  </code></pre>
  
  <p>How would I delete the possible spaces and commas at the end and beginning of strings. So for example, the last two strings would be converted to:</p>
  
  <pre><code>people,boys,girls
  people,boys,police
  </code></pre>
  
  <p>Moreover, I would like to delete the spaces between the commas.</p>
  
  <p>Thanks</p>