
- 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
Convert.ToChar Method in C#
The Convert.ToChar method is used to convert a specified value to a Unicode integer.
We have declared an sbyte variable.
sbyte byteVal = 200;
Now, use the Convert.ToChar() method to convert the sbyte value to a Unicode integer.
charVal = Convert.ToChar(b);
Let us see another example.
Example
using System; public class Demo { public static void Main() { sbyte[] byteVal = { 92, 111, 115 }; char charVal; foreach (sbyte b in byteVal) { charVal = Convert.ToChar(b); Console.WriteLine("{0} converted to '{1}'", b, charVal); } } }
Output
92 converted to '\' 111 converted to 'o' 115 converted to 's'
- Related Articles
- How to Convert the TimeSeries using the series.asfreq() method?
- Convert Long into String using toString() method of Long class in java
- Is there any method to convert a Set to immutable in Java
- Convert an object to another type using map() method with Lambda in Java?
- What is the equivalent of MySQL TIME_TO_SEC() method in PHP to convert datetime to seconds?
- Java Program to convert Double into String using toString() method of Double class
- How to convert a double value into a Java String using format method?
- How to convert a double value into a Java String using append method?
- Convert Class in C#
- Class method vs static method in Python
- Collections.replaceAll() method and List.replaceAll() method in Java
- The isEmpty() method of CopyOnWriteArrayList method in Java
- The hashCode() method of CopyOnWriteArrayList method in Java
- The clone() method of CopyOnWriteArrayList method in Java
- Default method vs static method in an interface in Java?
- Convert String to Long in Java

Advertisements