Refactoring find_last_of.