How can I remove all trailing dashes from a string?
<p>Example:</p>

<pre><code>string1 = 'title--'
string2 = 'title-'
string3 = 'this-is-a-title----'

&gt;&gt; print doSomething(string1)
&gt;&gt; title

&gt;&gt; print doSomething(string2)
&gt;&gt; title

&gt;&gt; print doSomething(string3)
&gt;&gt; this-is-a-title
</code></pre>

<p>Thanks for your help.</p>
