Python string find
来源:互联网 发布:2016淘宝网店经营策略 编辑:程序博客网 时间:2024/06/11 23:20
Python String find() Method
Advertisements
Previous Page
Next Page
Description
It determines if string str occurs in string, or in a substring of string if starting index beg and ending index end are given.
Syntax
str.find(str, beg=0 end=len(string))
Parameters
str -- This specifies the string to be searched.
beg -- This is the starting index, by default its 0.
end -- This is the ending index, by default its equal to the lenght of the string.
Return Value
Index if found and -1 otherwise.
Example
#!/usr/bin/pythonstr1 = "this is string example....wow!!!";str2 = "exam";print str1.find(str2)print str1.find(str2, 10)print str1.find(str2, 40)
Result
1515-1
0 0
- Python String find() Method
- Python string find
- python学习string method: find and rfind
- string find
- string find
- string find
- string.find()
- [leetcode: Python]438. Find All Anagrams in a String
- [python]leetcode(438). Find All Anagrams in a String
- string.find() string.substr();
- string::find string::npos
- python find()
- string::find 与 string::npos
- c++之string.find(string)
- [LzmTW].[String].[Find]
- find some string
- string find查找函数
- string copy find
- HDU 1312 Red and Black(BFS,DFS)
- ubuntu Linux下Codeblocks编译 SDL2.0工程
- ODPS MapReduce入门 - 推荐商品
- Cookie详解与应用(java,js)
- [编译原理]学习笔记(二)——文法和语言
- Python string find
- Android4.4 增加的/system/priv-app system/delapp跟 原来的/system/app 有啥区别呢?
- 图形用户界面(GUI)应用程序开发——菜鸟的第一步
- [汇编学习]在代码段使用栈
- ubuntu的apt-get update失败
- 盲打....头一次
- corefoundation与foundation的桥接问题
- hdu 5441 Travel(带权并查集)
- Linux驱动开发之 四 (那些必须要了解的硬件知识 之 串口)