Is Array - CSharp System

CSharp examples for System:Array Element

Description

Is Array

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Reflection;
using System.Linq;
using System.Collections.Generic;
using System.Collections;
using System;/*from   w  w w.  j av  a 2  s  .  c  o  m*/

public class Main{
        public static bool IsArray(Type arrayType)
        {
            if (!arrayType.GetTypeInfo().IsGenericType)
                return false;

            if (arrayType.GetGenericTypeDefinition() != typeof(List<>))
                return false;

            return true;
        }
}

Related Tutorials