value.GetType().GetElementType() == typeof(string)
as an added bonus (but I'm not 100% sure. This is the code I'm using ...)
var ienum = value.GetType().GetInterface("IEnumerable`1"); if (ienum != null) { var baseTypeForIEnum = ienum.GetGenericArguments()[0] }
with this you can search for List, IEnumerable ... and get T.
xanatos Mar 11 '11 at 15:38 2011-03-11 15:38
source share