擅长:python、mysql、java
<p>这是使<a href="https://docs.python.org/3/library/stdtypes.html#str.translate" rel="nofollow noreferrer">^{<cd1>}</a>在python3中工作的一种方法:首先使用<a href="https://docs.python.org/3/library/stdtypes.html#str.maketrans" rel="nofollow noreferrer">^{<cd2>}</a>创建一个表:</p>
<pre><code>tr_tbl = str.maketrans('','' , "1234567890_")
print('hello_i_am_from_casablanca78'.translate(tr_tbl))
</code></pre>