static bool IsNumeric(object Expression)



static bool IsNumeric(object Expression)
    // IsNumeric Function
    static bool IsNumeric(object Expression) {
    // Variable to collect the Return value of the TryParse method.
        bool isNum;

    // Define variable to collect out parameter of the TryParse method. If the conversion fails, the out parameter is zero.
        double retNum;

    // The TryParse method converts a string in a specified style and culture-specific format to its double-precision floating point number equivalent.
    // The TryParse method does not generate an exception if the conversion fails. If the conversion passes, True is returned. If it does not, False is returned.
        isNum = Double.TryParse(Convert.ToString(Expression), System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out retNum );
        return isNum;

IsDate 函数 (Visual Basic)
IsArray 函数 (Visual Basic)
IsDBNull 函数
IsError 函数
IsNothing 函数
IsNumeric 函数 (Visual Basic)
IsReference 函数
Object 数据类型
Date 数据类型 (Visual Basic)
TypeName 函数 (Visual Basic)


浏览次数 90 发布时间 2009-02-11 15:22:46 从属分类 【评论】【 】【打印】【关闭
| | 2006版 | 资料中心 | linux | asm/asm32 | C/C++ | VC++ | java | Python | 书签 | ASP.Net书签 | 京ICP备09029108号-1