C# Converting List to List

后端 未结 6 1691
星月不相逢
星月不相逢 2020-12-14 07:07

I have a List and I want to convert it to a List. Is there any way to do this other than just looping through the Li

6条回答
  •  心在旅途
    2020-12-14 07:34

    You can use ConvertAll method inside of .Net Framework 2.0 here is an example

            List lstInt = new List(new int[] { 1, 2, 3 });
            List lstDouble = lstInt.ConvertAll(delegate(int p)
            {
                return (double)p;
            });
    

提交回复
热议问题