Mega Code Archive

 
Categories / VB.Net / Reflection
 

Type IsArray tells whether the Type is an array

Imports System Class TestIsArray     Public Shared Sub Main()         Dim array As Integer() =  {1, 2, 3, 4}         Dim at As Type = GetType(Array)         Dim t As Type = array.GetType()         Console.WriteLine("The type is {0}. Is this type an array? {1}", at, at.IsArray)         Console.WriteLine("The type is {0}. Is this type an array? {1}", t, t.IsArray)     End Sub 'Main End Class 'TestType