Find the position of the last occurrence of a substring in a string