List转字符串

List<string> List = new List<string>();
string strArray = string.Join(",", List);

字符串转List

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数组

List<string> List = new List<string>();
string strArray = string.Join(",", List);
int[] list = Array.ConvertAll<string, int>(strArray.Split(','), s => int.Parse(s));

 

相关文章:

  • 2021-12-27
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2021-12-27
  • 2021-10-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2022-02-17
相关资源
相似解决方案