原文地址:https://www.cnblogs.com/ahwwmb/p/4166707.html

串联字符串数组的所有元素,其中在每个元素之间使用指定的分隔符

            List<string> arr = new List<string>();
arr.Add("好玩1");
arr.Add("好玩1");
arr.Add("好玩1");
string str = string.Join(",", arr.ToArray()); ArrayList arr1 = new ArrayList();
arr1.Add("好玩1");
arr1.Add("好玩2");
arr1.Add("好玩3");
string str1 = string.Join(",", arr1.ToArray(typeof(string)) as string[]);

  

C# List<string>和ArrayList用指定的分隔符分隔成字符串的更多相关文章

  1. String的split()方法可以将字符串按照特定的分隔符拆分成字符串数组

    在java.lang包中有String.split()方法,返回是一个数组------不管按照什么拆,拆出来是一个数组 String str = "1,2,3,4,5,6"; St ...

  2. 数组和List以指定的方式拼接成字符串类型

    /// <summary> /// list转换成格式的字符串 /// </summary> /// <param name="param">拼 ...

  3. C#部分---arraylist集合、arraylist集合中的object数据转换成int类string类等;间隔时间的表示方法;

    ArrayList和Array的区别: 相同点:1.两者都实现了IList.ICollection.IEnumerable接口:       2.两者都可以使用证书索引访问集合中的元素,包括读取和赋值 ...

  4. string[] 和 arraylist互转及问题解决

    1,String 数组转成 list<String> String[] s={"1","2","3","5" ...

  5. String[]和ArrayList和LinkedList区别

    String[]和ArrayList和LinkedList区别 参考文档如下: http://www.blogjava.net/flysky19/articles/92775.html http:// ...

  6. 将ArrayList<HashMap<String, String>>转为ArrayList<Bundle>类型的解决方案

    Bundle是一种利用键值对存储的数据格式,而我们在程序中通常利用HashMap存储数据.在开发中,通过Http请求得到JSONArray类型的返回值,我选择利用ArrayList<HashMa ...

  7. 【转载】C#使用InsertRange方法往ArrayList集合指定位置插入另一个集合

    在C#的编程开发中,ArrayList集合是一个常用的非泛型类集合,ArrayList集合可存储多种数据类型的对象.在实际的开发过程中,我们可以使用InsertRange方法在ArrayList集合指 ...

  8. 【转载】C#中使用Insert方法往ArrayList集合指定索引位置插入新数据

    ArrayList集合是C#中的一个非泛型的集合类,是弱数据类型的集合类,可以使用ArrayList集合变量来存储集合元素信息,在ArrayList集合操作过程中,可以使用ArrayList集合类的I ...

  9. String、String[]、ArrayList<String>之间的转换

    1. ArrayList<String> 转换为 String[]: ArrayList<String>  list = new ArrayList<>(); li ...

随机推荐

  1. IDEA错误:Cannot start compilation: the output path is not specified for module "XXX".

    错误是发生在从github上checkout自己的项目时.因为没有将配置文件一起上传,所以在运行java程序时有了这个报错: Cannot start compilation: the output ...

  2. BZOJ5340: [Ctsc2018]假面【概率+期望】【思维】

    LINK 思路 首先考虑减血,直接一个dp做过去,这个部分分不难拿 然后是\(op=1\)的部分 首先因为要知道每个人被打的概率,所以需要算出这个人活着的时候有多少个人活着时概率是什么 那么用\(g_ ...

  3. Python集成开发环境搭建

    ===================== 开始学习Python的开发,首先得搭建好集成开发的环境! 分为下面几个步骤: 操作系统平台:Windows XP/7/10 都可以 1.安装并配置JDK运行 ...

  4. LeetCode-Microsoft-Remove K Digits

    Given a non-negative integer num represented as a string, remove k digits from the number so that th ...

  5. 【java规则引擎】《Drools7.0.0.Final规则引擎教程》第4章 4.2 auto-focus

    转载至:https://blog.csdn.net/wo541075754/article/details/75349556 auto-focus 在agenda-group章节,我们知道想要让Age ...

  6. leetcode:Reverse Integer【Python版】

    1.在进入while之前,保证x是非负的: 2.符号还是专门用flag保存 =================== 3.另一思路:将integer转换成string,然后首位swap,直至中间: cl ...

  7. leetcode:Maximum Depth of Binary Tree【Python版】

    # Definition for a binary tree node # class TreeNode: # def __init__(self, x): # self.val = x # self ...

  8. Monocular 集成harbor helm 仓库

      harbor 已经支持了helm 仓库(使用chartmuseum),Monocular 是一个不错的helm 仓库可视化工具 测试Monocular集成harbor 私服功能 使用docker- ...

  9. SQL Server中如何实现遍历表的记录

    SQL Server遍历表一般都要用到游标,SQL Server中可以很容易的用游标实现循环,实现SQL Server遍历表中记录. 但游标在实际的开发中都不推荐使用. 我们知道还可以借助临时表或表变 ...

  10. 创意:Soap一款新型的触摸式家用智能路由器

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/iefreer/article/details/34808749 Soap简单介绍 这里的Soap不是 ...