C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
C# String GetType()The C# GetType() method is used to get type of current object. It returns the instance of Type class which is used for reflection. Signaturepublic Type GetType() ParametersIt does not take any parameter. ReturnIt returns object of Type class. C# String GetType() Method Exampleusing System; public class StringExample { public static void Main(string[] args) { string s1 = "Hello C#"; Console.WriteLine(s1.GetType()); } } Output: System.String
Next TopicC# String GetTypeCode()
|