String.GetTypeCode Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Assembly: mscorlib (in mscorlib.dll)
The following code example displays the TypeCode enumerated constant for the String type.
// Sample for String.GetTypeCode() using System; class Example { public static void Demo(System.Windows.Controls.TextBlock outputBlock) { String str = "abc"; TypeCode tc = str.GetTypeCode(); outputBlock.Text += String.Format("The type code for '{0}' is {1}, which represents {2}.", str, tc.ToString("D"), tc.ToString("F")) + "\n"; } } /* This example produces the following results: The type code for 'abc' is 18, which represents String. */
Show: