Refactoring find_last_not_of.