title: Remove duplicate set of strings in a hyphen separated big string
body: <p>I'm developing in Java, I have the following string: </p>
  
  <pre><code>String duplicates = "Smith, John - Smith, John - Smith, John – Wilson, Peter";
  </code></pre>
  
  <p>I need to get a new string with no duplicate names.</p>
  
  <pre><code>unique = "Smith, John – Wilson, Peter";
  </code></pre>
  
  <p>I thought I could use</p>
  
  <pre><code>String unique[] = duplicates.split("-");
  </code></pre>
  
  <p>Problem with splitting hyphens with commas is that now I have all commas</p>
  
  <pre><code>Smith, John, Smith, John, Smith, John, Wilson, Peter
  </code></pre>
  
  <p>Any help will be greatly appreciated</p>