1
可能重复:
How do I get the Array Item Type from Array Type in .net如何确定的基本类型的数组的
如果我有一个特定类型的数组有没有办法告诉类型是什么?
var arr = new []{ "string1", "string2" };
var t = arr.GetType();
t.IsArray //Evaluates to true
//How do I determine it's an array of strings?
t.ArrayType == typeof(string) //obviously doesn't work