python 英文字串首字母改为大写
#英文字串首字母改为大写 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'
- 上一篇 »php模板页语法
- 下一篇 »Python 获取中文的首字母 和 全部拼音首字母