List转字符串
[C#] 纯文本查看 复制代码
01
02
|
List< string > List = new List< string >(); string strArray = string .Join( "," , List); |
字符串转List
[C#] 纯文本查看 复制代码
01
02
|
string str = "2,4,4,4" ; List< string > List= new List< string > (str.Split( ',' )) |
字符数组转Int数组
[C#] 纯文本查看 复制代码
01
02
|
string str = "2,4,4,4" ; int [] list = Array.ConvertAll< string , int >(str.Split( ',' ), s => int .Parse(s)); |
List<string>字符串转Int数组
[C#] 纯文本查看 复制代码
01
02
03
|
List< string > List = new List< string >(); string strArray = string .Join( "," , List); int [] list = Array.ConvertAll< string , int >(strArray.Split( ',' ), s => int .Parse(s)); |
http://www.sufeinet.com/thread-9610-1-1.html