📜  python string index of - Python 代码示例

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

代码示例3
sentence = 'Python programming is fun.'

result = sentence.index('is fun')
print("Substring 'is fun':", result)

result = sentence.index('Java')
print("Substring 'Java':", result)