擅长:python、mysql、java
<p>一个简单的方法:</p>
<pre><code>my_string = 'italic'
newstr = my_string[0]
newstr = newstr.upper()
my_string = newstr + my_string[1:]
</code></pre>
<p>使其小写(第一个字母除外):</p>
<pre><code>my_string= 'ITALIC'
newstr = my_string[1:]
newstr = newstr.lower()
my_string = my_string[0] + newstr
</code></pre>
<p>我不知道是否有一个内置的来做这件事,但这应该是可行的。</p>