📜  字符串索引 - Python 代码示例

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

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

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

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