Answers for "print a list to a string"

4

python print list as string

list1 = ['1', '2', '3']
str1 = ''.join(list1)
Posted by: Guest on May-11-2020
0

Convert a List to a String

using System;
using System.Collections.Generic;
 
public class Example
{
    public static void Main()
    {
        List<string> list = new List<string>() { "A", "B", "C" };
        char delim = ',';
 
        string str = String.Join(delim, list);
        Console.WriteLine(str);
    }
}
 
/*
    Output: A,B,C
*/
Posted by: Guest on March-12-2022

Python Answers by Framework

Browse Popular Code Answers by Language