List轉字符串數組
List<string> List = new List<string>(); string strArray = string.Join(",", List);
字符串轉Listblog
string str = "2,4,4,4"; List<string> List=new List<string> (str.Split(','))
字符數組轉Int數組字符串
string str = "2,4,4,4"; int[] list = Array.ConvertAll<string, int>(str.Split(','), s => int.Parse(s));
List<string>字符串轉Int數組string
List<string> List = new List<string>(); string strArray = string.Join(",", List); int[] list = Array.ConvertAll<string, int>(strArray.Split(','), s => int.Parse(s));