![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
string
z蜗牛
这个作者很懒,什么都没留下…
展开
-
string.capwords()--将字符串中所有单词的首字母大写
>>> import string>>> s = 'The quick brown fox jumped over the lazy dog.'>>> print(s)The quick brown fox jumped over the lazy dog.>>> print(string.capwords(s))The Quick Brown Fox Jumped Over The L原创 2014-11-29 15:06:06 · 949 阅读 · 0 评论 -
string.Template--字符串模板
使用模板进行操作>>> import string>>> values = {'var':'foo'}>>> t = string.Template("""... Variable : $var... Escape : $$... Variable in text: ${var}iable... """)>>> print('TEMPLATE:',原创 2014-11-29 15:25:59 · 486 阅读 · 0 评论