如何查找字符串中最后一个字符的位置?
string = "abcd}def}" string = string.find('}',last) # Want something like this
您可以使用rfind:
rfind
>>> "abcd}def}".rfind('}') 8