arrays - How to do typeof object[*] in C#? -
i'm new c# have searched web hour , no joy...
i need ascertain whether object non-zero index array, i.e. object[*]
i've tried:
if(v != null && v.gettype() == typeof(object[*])) and if(v object[*])
as overloaded methods method(object v) , method(object[*] v)
all result in compilation errors.
as can't cast object[*] object[] , test getlowerbound(0) how hell can test type?
(please don't tell me bad code/design, it's coming excel cannot change that).
try type.isarray, type.getarrayrank , type.getelementtype if necessary.
if need call getlowerbound can safely cast object system.array.
Comments
Post a Comment