#英文字串首字母改为大写 st = "string" St = st[0].upper() + st[1:]
2016-10-22
后来了解到 python 内部有相关实现,感觉 python 好贴心~~~
>>> "hehe he hehe".capitalize()
'Hehe he hehe'
>>> "hehe he hehe".title()
'Hehe He Hehe'
#英文字串首字母改为大写 st = "string" St = st[0].upper() + st[1:]
2016-10-22
后来了解到 python 内部有相关实现,感觉 python 好贴心~~~
>>> "hehe he hehe".capitalize()
'Hehe he hehe'
>>> "hehe he hehe".title()
'Hehe He Hehe'
转载于:https://www.cnblogs.com/learn-to-rock/p/5451192.html