hello_str = "hello python"
# 1、判断是否以指定的字符串开始
print(hello_str.startswith("hello"))
# 2、判断是否以指定的字符串结束
print(hello_str.endswith("python"))
# 3、查找指定字符串
# index方法同样可以查找指定的字符串在大字符串的索引
# find如果指定的字符串不存在则会返回-1
print(hello_str.find("llo"))
# index如果指定的字符串不存在,会报错
# print(hello_str.index("abc"))
# 4、查找字符串
# replace方法执行完成后,会返回一个字符串
# 注意:不会修改原有的字符串
print(hello_str.replace("python","world"))
print(hello_str)



