remove duplicates from a string