Python的find()
来源:互联网 发布:朴尔因子怎么样 知乎 编辑:程序博客网 时间:2024/05/26 22:06
find()函数
find()函数会在原字符串中查找参数传入的子字符串,如果没有找到请求的字符串就会返回-1,否则返回找到的子字符串的第一个字符在原字符串中的索引位置。
代码实现
weather = 'sunny day'bag = 'nothing in the bag'if weather.find('rain') != -1: bag = bag.replace('nothing','umbrella')print bag
0 0
- python的 find()用法
- Python的find()
- python find 遇到的问题
- python中find()的用法
- python中find()的用法
- python find()
- Python的BeautifulSoup的find()和findAll()
- Python ElementTree的find,findall函数参数
- python的正则匹配,match和find
- python str.find使用的注意事项
- Python中find()方法的使用
- python的读写文件和find函数
- python中index()与find()的区别
- python find() 与 rfind()的区别
- python list 的 index() 和 find()
- Python爬虫:BeautifulSoup的find()和findAll()
- Python的BeautifulSoup之find和find_all
- python的装饰器和find函数的使用
- Android系统移植与平台开发(四) - led HAL简单设计案例分析
- IOS-UITextFile最全总结
- Android SDK 目录下的文件夹主要是干什么的
- 回调函数(callback)浅析
- 集成电路概论
- Python的find()
- Zabbix支持的主要监控方式
- 设计模式C++实现(9)——享元模式
- CSS中margin和padding的区别
- HDU 3355 Hop — Don’t Walk!
- 批处理获取拖拽文件的全路径
- neutron使用metering服务监控内网流量
- 设计模式C++实现(10)——桥接模式
- C 实现ArrayQueue队列