摘要:
Python中的splitlines用来分割行。当传入的参数为True时,表示保留换行符 \n。通过下面的例子就很明白了:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--mulLine="""Hello!!!WellcometoPython'sworl... 阅读全文
摘要:
转换大小写和其他语言一样,Python为string对象提供了转换大小写的方法:upper() 和 lower()。还不止这些,Python还为我们提供了首字母大写,其余小写的capitalize()方法,以及所有单词首字母大写,其余小写的title()方法。函数较简单,看下面的例子:Code highlighting produced by Actipro CodeHighlighter (fr... 阅读全文