
- 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
Char.GetTypeCode() Method with Examples in C#
The Char.GetTypeCode() method in C# is used to return the TypeCode for value type Char.
Syntax
Following is the syntax −
public TypeCode GetTypeCode ();
Example
Let us now see an example to implement the Char.GetTypeCode() method −
using System; public class Demo { public static void Main(){ char val = '5'; bool res; Console.WriteLine("Hashcode for val = "+val.GetHashCode()); res = val.Equals('m'); Console.WriteLine("Return Value = "+res); Console.WriteLine("Numeric Value = "+Char.GetNumericValue(val)); TypeCode type = val.GetTypeCode(); Console.WriteLine("Type = "+type); } }
Output
This will produce the following output −
Hashcode for val = 3473461 Return Value = False Numeric Value = 5 Type = Char
Example
Let us now see another example −
using System; public class Demo { public static void Main(){ char val = 'B'; TypeCode type = val.GetTypeCode(); Console.WriteLine("Type = "+type); } }
Output
This will produce the following output −
Type = Char
- Related Articles
- UInt16.GetTypeCode() Method in C# with Examples
- Int32.GetTypeCode Method in C# with Examples
- UInt64.GetTypeCode() Method in C# with Examples
- UInt32.GetTypeCode() Method in C# with Examples
- Int16.GetTypeCode Method in C# with Examples
- Int64.GetTypeCode Method in C# with Examples
- Char.ToUpperInvariant(Char) Method in C#
- Char.ToLowerInvariant(Char) Method in C#
- Uri.HexEscape(Char) Method in C#
- MathF.Tan() Method in C# with Examples
- MathF.Tanh() Method in C# with Examples
- MathF.Truncate() Method in C# with Examples
- MathF.Sin() Method in C# with Examples
- MathF.Sinh() Method in C# with Examples
- MathF.Sqrt() Method in C# with Examples
- Decimal.GetHashCode() Method in C# with Examples

Advertisements