String is not null, empty, or empty string

后端 未结 6 809
礼貌的吻别
礼貌的吻别 2021-01-04 07:18

What is the quickest and easiest way (in Classic ASP) to check if a string has some string (that has a length greater than 0) i.e. NOT \"Null\", \"Nothing\", \"Empty\", or \

6条回答
  •  礼貌的吻别
    2021-01-04 08:03

    You can use the VarType() function to check if it is a string, then you can check if the string is not empty. This statement will only pass through a string that isn't empty.

    If VarType(MyString) = 8 Then
      If MyString <> "" Then 
        'String is Not Null And Not Empty, code goes here
    
      End If
    End If
    

提交回复
热议问题