方法一:find("xxx")
如果查到了,返回的是位置,如果查不到,返回的是-1
方法二:rfind("xxx")
与find 的作用是一样的
方法三:index("xxx")
如果查到了,返回的是位置,如果查不到,返回的是-错误提示
ValueError:substring not found
方法四:rindex("xxx")
与方法三一样
方法一:find("xxx")
如果查到了,返回的是位置,如果查不到,返回的是-1
方法二:rfind("xxx")
与find 的作用是一样的
方法三:index("xxx")
如果查到了,返回的是位置,如果查不到,返回的是-错误提示
ValueError:substring not found
方法四:rindex("xxx")
与方法三一样