C# String GetType() Method

You are Here:

C# String GetType()

The GetType() method gets the type of the current instance.


C# Compiler
using System; namespace myApp { class Program { static void Main(string[] args) { string s = "wikimass"; float fnum = 1.5f; int inum = 13; char ch = 'G'; short snum = 56; Console.WriteLine(s.GetType()); Console.WriteLine(fnum.GetType()); Console.WriteLine(inum.GetType()); Console.WriteLine(ch.GetType()); Console.WriteLine(snum.GetType()); } } }


System.String System.Single System.Int32 System.Char System.Int16


public Type GetType()

Parameter Values

It does not take any parameter.

Return Value

DataTypeReturns the exact runtime type of the current instance.


Hi Developers, we almost covered 90% of String functions and Interview Question on C# with examples for quick and easy learning.

We are working to cover every Single Concept in C#.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author