title: Ruby string strip defined characters
body: <p>In Python, we can use the <a href="https://docs.python.org/library/stdtypes.html#str.strip" rel="noreferrer"><code>.strip()</code></a> method of a string to remove leading or trailing occurrences of chosen characters:</p>
  
  <pre><code>>>> <b>print " (Removes (only) leading & trailing brackets & ws ) ".strip(" ()")</b>
  'Removes (only) leading & trailing brackets & ws'</code></pre>
  
  <p>How do we do this in Ruby? Ruby's <a href="http://www.ruby-doc.org/core-2.1.5/String.html#method-i-strip" rel="noreferrer"><code>strip</code></a> method takes no arguments and strips only whitespace.</p>