예제 #1
0
        static void Main(string[] args)
        {
            // Task timeout
            //SimpleTask.Test();
            //var i = SimpleConvert.To<int>("123");
            List <string> words = new List <string> {
                "A", "B", "C"
            };
            var list = SimpleConvert.SplitList <string>(words, 2);

            foreach (var item in list)
            {
                Console.WriteLine(string.Join(" ", item));
            }
            list = SimpleConvert.SplitList <string>(words, 4);
            foreach (var item in list)
            {
                Console.WriteLine(string.Join(" ", item));
            }
            list = SimpleConvert.SplitList <string>(words, 0);
            foreach (var item in list)
            {
                Console.WriteLine(string.Join(" ", item));
            }
            Console.WriteLine("Hello World!");
            Console.Read();
        }
예제 #2
0
        public static void Test2()
        {
            var list = new List <int>();

            for (int i = 1; i <= 1000; i++)
            {
                list.Add(i);
            }
            var sList = SimpleConvert.SplitList <int>(list, 50);
            var nList = sList.AsParallel().SelectMany(l => l.Select(i => i.ToString())).ToList();

            Console.WriteLine(JsonConvert.SerializeObject(nList));
        }