擅长:python、mysql、java
<p>如果字符串中已经有了所有内容,只需使用<a href="http://docs.python.org/library/stdtypes.html#str.translate" rel="nofollow">^{<cd1>}</a>:</p>
<pre><code>>>> s
"hello there ! this is a string with $ some % characters I & don't ( want!"
>>> s.translate(None,"$!%&(")
"hello there this is a string with some characters I don't want"
</code></pre>