码迷,mamicode.com
首页 > 其他好文 > 详细

[csharp] bool IsNumeric(Type type)

时间:2017-08-01 19:21:48      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:csharp   get   type   style   class   bsp   false   log   ase   

static bool IsNumeric(Type type)
{
    switch (Type.GetTypeCode(type))
    {
        case TypeCode.Byte:
        case TypeCode.SByte:
        case TypeCode.UInt16:
        case TypeCode.UInt32:
        case TypeCode.UInt64:
        case TypeCode.Int16:
        case TypeCode.Int32:
        case TypeCode.Int64:
        case TypeCode.Decimal:
        case TypeCode.Double:
        case TypeCode.Single:
            return true;
        default:
            return false;
    }
}

 

[csharp] bool IsNumeric(Type type)

标签:csharp   get   type   style   class   bsp   false   log   ase   

原文地址:http://www.cnblogs.com/Bob-wei/p/7269874.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!