title: String Builder-removing duplicate values
body: <p>I have written this small code where i am getting values from lstmodel2 components.   </p>
  
  <pre><code> StringBuilder sb=new StringBuilder();
              for (int i = 0; i &lt; lstmodel2.getSize(); i++) {
                 String[] exsplt=lstmodel2.get(i).toString().split("\\.");
                 sb.append(exsplt[0]);
                 sb.append(" ,");
              }
              System.out.println(sb);
  </code></pre>
  
  <p>sb gives me </p>
  
  <blockquote>
    <p>axledetails ,axledetails ,contacts ,contacts ,material_master
    ,supplier_master ,</p>
  </blockquote>
  
  <p>I want to eliminate the duplicate entries from the String Builder so that the output would be</p>
  
  <blockquote>
    <p>axledetails ,contacts ,material_master ,supplier_master ,</p>
  </blockquote>
  
  <p>Kindly give some suggestion how to do this.</p>