孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

如判断字符串是否为空

<%

    Public Function Validation(Pattern,string1)

        Dim RegExp1,Matches

        Set RegExp1=New RegExp

        RegExp1.Pattern=Pattern

        RegExp1.IgnoreCase=True

        RegExp1.Global=True

        Matches=RegExp1.Test(string1)

        Validation=Matches

    End Function

 

    Public Function CheckIsEmpty(string1)

        CheckIsEmpty=Validation("^$",Trim(string1))        

    End Function

 

    If CheckIsEmpty("")=True then

        Response.Write(" is Empty"

    Else

        Response.Write(" is not Empty")

    End If

%>

posted on 2008-09-21 09:07  孤独的猫  阅读(136)  评论(0编辑  收藏  举报