StringBuilder builder = new StringBuilder("我是中国人我爱中过");
for(int i=0;i<builder.length();i++){
for(int j = i+1;j<builder.length();j++){
if(builder.charAt(i) == builder.charAt(j)){
builder.deleteCharAt(j);
}
}
}
System.out.println(builder.toString());
for(int i=0;i<builder.length();i++){
for(int j = i+1;j<builder.length();j++){
if(builder.charAt(i) == builder.charAt(j)){
builder.deleteCharAt(j);
}
}
}
System.out.println(builder.toString());