stuff.split("xxxx")
来源:互联网 发布:卡司数据 编辑:程序博客网 时间:2024/06/05 19:54
>>> words = "abc def".split()>>> words[0]26: 'abc'>>> words[0][0]27: 'a'
这个例子中,第一个word的第一个字母是'a',而不是单引号。
另外,split()没有参数时,会按所有的空格符(包括连续的white space, tab以及换行符)分割,
>>> sentence = "a sentence\tthat \thas different\nspace characters">>> sentence.split(' ')28: ['a', '', 'sentence\tthat', '\thas', 'different\nspace', 'characters']>>> sentence.split()29: ['a', 'sentence', 'that', 'has', 'different', 'space', 'characters']>>> sentence.split('\t')30: ['a sentence', 'that ', 'has different\nspace characters']
阅读全文
0 0
- stuff.split("xxxx")
- stuff
- xxxx
- xxxx
- XXXX
- xxxx
- xxxx
- xxxx
- XXXX
- XXXX
- XXXX
- xxxx
- xxxx
- xxxx
- XXXX
- xxxx
- xxxx
- xxxx
- 493. Reverse Pairs
- urllib和urllib2区别和常见用法
- tomcat启动时错误Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of th
- LinuxStudyNote(36)-Vim(2)-Vim使用技巧 :r、:map快捷键设置、:ab、添加注释快捷键、添加多行注释快捷键、邮箱添加快捷键
- 理解Java内部类 匿名内部类
- stuff.split("xxxx")
- leetcode 35. Search Insert Position(C语言,查询插入位置)19
- eclipse中Tomcat启动时报错Cannot assign requested address
- Java图片处理开源框架
- 数组的原地排序和保护排序
- 适配器设计模式
- 栈和队列---最大值减去最小值小于或等于num的子数组数量
- PAT 甲级 1055. The World's Richest (25)
- 敏捷转型中常见的问题