擅长:python、mysql、java
<p>您也可以使用此选项:</p>
<pre><code>def GetPart(s,part=1):
out = s.split('=')[part].strip() #only '=', spaces will be removed
return out
>>> s = 'abcd=efgh'
>>> GetPart(s)
>>> 'efgh'
>>> s = 'abcd= efgh' #note extra spaces
>>> GetPart(s)
>>> 'efgh'
>>> s = 'abcd = efgh ' #even more space before/after
>>> GetPart(s)
>>> 'efgh'
</code></pre>
<p>当然还有:</p>
^{pr2}$