IBM interview question

How would you remove duplicates from an infinitely long string?