擅长:python、mysql、java
<p>使用<code>str.startswith</code>检查字符串是否以<code>j</code>开头,然后使用切片将其删除。你知道吗</p>
<p><strong>例如:</strong></p>
<pre><code>x = ["james", "john", "robert", "michael", "william", "david", "richard", "charles", "joseph", "thomas", "christopher"]
print([i[1:] if i.startswith("j") else i for i in x])
</code></pre>
<p><strong>输出:</strong></p>
<pre><code>['ames', 'ohn', 'robert', 'michael', 'william', 'david', 'richard', 'charles', 'oseph', 'thomas', 'christopher']
</code></pre>