← 返回列表

Python3 字符串String Rfind 方法

Python3 字符串String Rfind 方法 #!/usr/bin/python3 str1 = "this is really a string example....wow!!!" str2 = "is" print (str1.rfind(str2)) print (str1.rfind(str2, 0, 10)) print (str1.rfind(str2, 10, 0)) print (str1.find(str2)) print (str1.find(str2, 0, 10)) print (str1.find(str2, 10, 0))

Python3 字符串String Rfind 方法

#!/usr/bin/python3

str1 = "this is really a string example....wow!!!"
str2 = "is"

print (str1.rfind(str2))
print (str1.rfind(str2, 0, 10))
print (str1.rfind(str2, 10, 0))

print (str1.find(str2))
print (str1.find(str2, 0, 10))
print (str1.find(str2, 10, 0))

打开资源 ↗

交流与评论