标签:ret ini proc logs replace 笔记 span finish env
1 #!/usr/bin/env python
2 r = "asada"
3 ret = r.find("d")
4 print(ret)#返回所在位置的索引
5 ret =r.split("d")
6 print(ret)#分隔
7 ret = r.replace("sa","k")
8 print(ret)#替换
结果C:\Python35\python3.exe F:/Python/笔记1/a1.py
3
[‘asa‘, ‘a‘]
akda
Process finished with exit code 0
标签:ret ini proc logs replace 笔记 span finish env
原文地址:http://www.cnblogs.com/shiluoliming/p/6394985.html