去重复算法

    ///
        /// 去重复算法
        ///

        ///
        ///
        public static string[] clear(string[] values)
        {
            List item = new List();
            for (int i = 0; i < values.Length; i++)
            {
                bool tre = true;
                for (int j = 0; j < item.Count; j++)
                {
                    if (item[j] == values[i])
                    {
                        tre = false;
                        break;
                    }
               
                }
                if (tre)
                {
                    item.Add(values[i]);
                }
           
            }
            return item.ToArray();
       
       
        }

转载于:https://www.cnblogs.com/tonysun/archive/2010/04/21/1717042.html

你可能感兴趣的:(去重复算法)