public string[] deleteRepeat( string[] mobile) {c++
List d_index = new List();//重复数据的索引放在这里索引
List a_index = new List();//非重复数据的索引放在这里string
for (int i = 0; i < mobile.Length-1; i++) {mobile
int c = -1;//其实这里用bool更好一点foreach
for (int k = 0; k < d_index.Count; k++) {List
if (i == d_index[k]) {数据
c++; continue;//判重co
}let
}new
if (c > -1)
continue;
a_index.Add(i);//在前面确保无重复的状况下,把索引添加到list里面
for (int j = i + 1; j < mobile.Length; j++) {
if (mobile[i].Equals(mobile[j])) {
d_index.Add(j);//发现重复,把索引添加到list里面
}
}
}
string[] res_mobile = new string[a_index.Count];
int count = 0;
foreach (int i in a_index) {
res_mobile[count] = mobile[i]; count++;
}
return res_mobile;//返回的非重复数据
}