How would I find the last occurrence of a character in a string?

string = "abcd}def}"
string = string.find('}',last) # Want something like this

You can use rfind:

>>> "abcd}def}".rfind('}')
8