python find rfind
2017-11-18 00:24
148 查看
mstr = "aa"; print(mstr.find("a")) print(mstr.rfind("a"))print(mstr.rfind("b"))
结果
0
1
-1
find ===》从左向右第一个的index
rfind ===》从右向左第一个的index
找不到则返回-1
相关文章推荐
- python find() 与 rfind()的区别
- 使用OpenCV的findContours获取轮廓并切割(python)
- anaconda安装Opencv报错:Could NOT find PythonLibs: Found unsuitable version "2.7.6",
- Python网络爬虫(2)处理网页数据find和findall函数
- python BeautifulSoup find 方法
- python py2exe打包matplotlib Could not find the matplotlib data files问题解决
- Python error: Unable to find vcvarsall.bat
- [python] can not find app ,module
- Python正则表达式---全部能匹配的子串迭代器finditer及findall及以中文匹配部分中文
- GemFI安装中的'Error: can't find library -lpthread required by python'
- [Leetcode,python] Find All Numbers Disappeared in an Array 寻找数组中消失的数字
- Python_API_String Services_string.find
- python中正则表达式 re.findall 用法
- Win7 64位编译Python扩展解决”error: Unable to find vcvarsall.bat”问题
- python第三方类库安装遇到error: Unable to find vcvarsall.bat
- python—解决“Unable to find vcvarsall.bat”错误
- Python3的re.match()、re.search()和re.findall()
- unable to find vcvarsall.bat python3.5
- python HTTPlib &&find,seek
- Python中的rfind()方法使用详解