Remove duplicate characters from string