展开全部
String id[]={"0","1","1","2","2","3","3","3","3","3"};
Set set=new HashSet();
for(int k=0;k<id.length;k++){
set.add(id[k]);
}
Iterator it = set.iterator();
String s = "";
for (; it.hasNext();) {
s += it.next() + ",";
}
System.out
.println("-----------------" + s.substring(0, s.length() - 1));
以上方法供参考,望采纳。。。
Set set=new HashSet();
for(int k=0;k<id.length;k++){
set.add(id[k]);
}
Iterator it = set.iterator();
String s = "";
for (; it.hasNext();) {
s += it.next() + ",";
}
System.out
.println("-----------------" + s.substring(0, s.length() - 1));
以上方法供参考,望采纳。。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询