But here's an example:
Dim desiredType as Type
if IsNumeric(desiredType) then ...
EDIT: I only know the Type, not the Value as a string.
Ok, so unfortunately I have to cycle through the TypeCode.
But this is a nice way to do it:
if ((desiredType.IsArray))
return 0;
switch (Type.GetTypeCode(desiredType))
{
case 3:
case 6:
case 7:
case 9:
case 11:
case 13:
case 14:
case 15:
return 1;
}
;return 0;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…