📜  python 字符串查找 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:48.137000             🧑  作者: Mango

代码示例1
The find() method returns the index of first occurrence of the substring
(if found). If not found, it returns -1.
message = 'Python is a fun programming language'

# check the index of 'fun'
print(message.find('fun'))

# Output: 12