List<string> 转 List<int>
var list = (new[]{"1","2","3"}).ToList();var newlist = list.Select<string,int>(x =>Convert.ToInt32(x));
List<int> 转List<string>
List<int> list = new List<int>(new int[] { 1,2,3 } ); List<string> newList = list.ConvertAll<string>(x => x.ToString());
时间: 2024-10-04 20:31:35