![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Char.ToString() Method in C#
The Char.ToString() method in C# is used to convert the value of this instance to its equivalent string representation.
Syntax
Following is the syntax −
public override string ToString ();
Example
Let us now see an example to implement the Char.ToString() method −
using System; public class Demo { public static void Main(){ char ch = 'p'; Console.WriteLine("Value = "+ch); char res1 = Char.ToLowerInvariant(ch); Console.WriteLine("Lowercase Equivalent = "+res1); string res2 = ch.ToString(); Console.WriteLine("String Equivalent = "+res2); } }
Output
This will produce the following output −
Value = p Lowercase Equivalent = p String Equivalent = p
Example
Let us now see another example −
using System; public class Demo { public static void Main(){ char ch = 'D'; Console.WriteLine("Value = "+ch); char res1 = Char.ToLowerInvariant(ch); Console.WriteLine("Lowercase Equivalent = "+res1); string res2 = ch.ToString(); Console.WriteLine("String Equivalent = "+res2); } }
Output
This will produce the following output −
Value = D Lowercase Equivalent = d String Equivalent = D
Advertisements