Gets a bool value that indicates whether the current Type represents an array.
true if the current Type represents an array; otherwise false.
This property is read-only.
This property returns true for an array of objects, but not for the Array type itself, which is a class.
If the current instance represents a generic type, or a type parameter of a generic type or method, this property returns false.
The following example demonstrates using the Type.IsArray property.
C# Example
using System; class TestType { public static void Main() { int [] array = {1,2,3,4}; Type at = typeof(Array); Type t = array.GetType(); Console.WriteLine("Type is {0}. IsArray? {1}", at, at.IsArray); Console.WriteLine("Type is {0}. IsArray? {1}", t, t.IsArray); } }The output is
Type is System.Array. IsArray? False
Type is System.Int32[]. IsArray? True
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0