python字符串方法分类
1、打开sublime text 3编辑器,新建一个PY文件。

3、test = " hey "test_new = test.strip()删减类的经常用来去除一些不必要的字符,比如空格,strip()可以去除两头的。

5、test = "hey you where are you"test_new = test.split()分切类最常见的就是split(),也就是把字符串变为列表。

7、test = "hey you where are you"test_new = test.find("where")查找类的,可以快速定位到字符的第一个序号。

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:65
阅读量:32
阅读量:35
阅读量:68
阅读量:38