去除数组中的重复数据

//去除数组中的重复数据
protected string[] removeDuplicate(string[] ArrInput)
{
System.Collections.ArrayList nStr = new System.Collections.ArrayList();
for (int i = 0; i < ArrInput.Length; i++)
{
if (!nStr.Contains(ArrInput[i]))
{
nStr.Add(ArrInput[i]);
}
}
return (string[])nStr.ToArray(typeof(string));
}
发布了115 篇原创文章 · 获赞 3 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/zhongguowangzhan/article/details/78551852