Esempio n. 1
0
        public CombinClass GetSubCombin(int lng)
        {
            CombinClass ret = new CombinClass();

            this.ForEach(a => {
                CombinClass subcmb = new CombinClass(a, lng);
                ret = ret.Union(subcmb);
            });
            return(ret);
        }
Esempio n. 2
0
        public CombinClass Inner(CombinClass obj)
        {
            CombinClass ret = new CombinClass();

            if (obj == null)
            {
                return(ret);
            }
            this.ForEach(a => {
                if (obj.Contains(a))
                {
                    ret.Add(a);
                }
            });
            return(this);
        }
Esempio n. 3
0
        public CombinClass Subtract(CombinClass obj)
        {
            CombinClass ret = new CombinClass();

            if (obj == null || obj.Count == 0)
            {
                return(this);
            }
            this.ForEach(a => {
                if (!obj.Contains(a))
                {
                    ret.Add(a);
                }
            });
            return(ret);
        }
Esempio n. 4
0
        public CombinClass Union(CombinClass obj)
        {
            CombinClass ret = new CombinClass();

            if (obj == null)
            {
                return(this);
            }
            ret.AddRange(obj);
            this.ForEach(a => {
                if (!ret.Contains(a))
                {
                    ret.Add(a);
                }
            });
            return(ret);
        }
Esempio n. 5
0
        public CombinClass Reconvert(string[] s, string splitor = ",")
        {
            if (s == null || s.Length == 0)
            {
                return(this);
            }
            if (this.Count > 0 && s.Length > 0)
            {
                if (this[0].Split(splitor.ToCharArray()).Length >= s.Length)
                {
                    return(this);
                }
            }
            CombinClass ret = new CombinClass();

            for (int i = 0; i < this.Count; i++)
            {
                string[] curritem = this[i].Split(splitor.ToCharArray());
                ret.Add(string.Join(splitor, getReconvertString(s, curritem)));
            }
            return(ret);
        }