标签:src 自定义 mic color 需求 技术 inf title 方法
python 内置首字母大写的方法title(),可以满足一般的需求 ,但是title()方法 会把除了首字母之外的字母变为小写 ,这时候就需要自定义首字母大写的方法了
1 # 首字母大写 2 def firstUp(title): 3 new_str = ‘{}{}‘.format(title[0].upper(), title[1:]) 4 return new_str
测试:
执行结果
标签:src 自定义 mic color 需求 技术 inf title 方法
原文地址:https://www.cnblogs.com/sunxun001/p/13180597.html