
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
C# program to convert a list of characters into a string
Firstly, declare the character array and set the value of each character −
char[] ch = new char[5]; ch[0] = 'H'; ch[1] = 'e'; ch[2] = 'l'; ch[3] = 'l'; ch[4] = 'o';
Now, use the string class constructor and create a new string from the above array of characters −
string myChar = new string(ch);
Example
Let us see the code to convert a list of characters to string in C#.
using System; namespace Demo { class MyApplication { static void Main(string[] args) { char[] ch = new char[5]; ch[0] = 'H'; ch[1] = 'e'; ch[2] = 'l'; ch[3] = 'l'; ch[4] = 'o'; string myChar = new string(ch); Console.WriteLine("Converted to string = {0}", myChar); } } }
Output
Converted to string = Hello
- Related Articles
- Java program to convert a list of characters into a string
- How to convert a list of characters into a string in C#?
- How can we convert a list of characters into a string in Python?
- Convert a String to a List of Characters in Java
- How to convert an array of characters into a string in C#?
- Convert a String into a square matrix grid of characters in C++
- Swift Program to convert the array of characters into the string
- Swift Program to convert the string into an array of characters
- Python Program to convert the array of characters into the string
- Convert List of Characters to String in Java
- Python Program To Convert An Array List Into A String And Viceversa
- Convert a string representation of list into list in Python
- C++ Program to convert the string into a floatingpoint number
- Convert characters of a string to opposite case in C++
- Python program to convert a list to string

Advertisements