C# 将List<string>转换为List<double>

//string转List
List strList = new List();
strList.Add("100"); strList.Add("500"); strList.Add("700");
List douList = strList.ConvertAll(s => Convert.ToDouble(s));

string str = "600 650 700";
List douList2 = str.Split(' ').ToList().ConvertAll(s => Convert.ToDouble(s));

//List转string
string douStr = string.Join(" ", douList2.ConvertAll(s => Convert.ToString(s)));//douStr : 600 650 700

 

你可能感兴趣的:(C#,C#,List,string,List,double,list转换)