zoukankan      html  css  js  c++  java
  • C# 数组、集合和字符串之间的相互转换

    字符串转为数组

    string str = "1,2,3,4";

    string[] strArr = str.Split(',');

    数组转为字符串

    string[] scoresArr = { "1", "2", "3", "4", "5" };
    string scores = string.Join(",", scoresArr);

    字符串转为集合

    string str = "a,b,c";

    List<string> strList = str.Split(',').ToList();

    集合转为字符串

    List<string> abcList = new List<string> { "a", "b", "c", "d" };
    string str = string.Join(",", abcList);

  • 相关阅读:
    监听
    用户管理
    oracle网络
    实例 参数
    存储管理
    oracle 体系
    实例
    修改
    集合操作
    17.08.18
  • 原文地址:https://www.cnblogs.com/bkyqtr/p/14463865.html
Copyright © 2011-2022 走看看