Use rpartition(s). It does exactly that.

You can also use rsplit(s, 1).