擅长:python、mysql、java
<p>使用正则表达式。你知道吗</p>
<p><strong>例如:</strong></p>
<pre><code>import re
companylist=['dell inc corp', 'co dell corp inc', 'co dell corp inc co']
for i in companylist:
print(re.sub(r"\W(corp|inc|co)\b", "", i))
</code></pre>
<p><strong>输出:</strong></p>
<pre><code>dell
co dell
co dell
</code></pre>