String is not null, empty, or empty string

后端 未结 6 810
礼貌的吻别
礼貌的吻别 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 07:44

    You could try having something like this:

    Function nz(valToCheck, valIfNull)
     If IsNull(valToCheck) then
        nz = valIfNull
     Else
        nz = valToCheck
     End if
    End function
    

    and then you would use it like this:

    if nz(var,"") <> "" then
      '--string has something in it
    else
      '--string is null or empty
    end is
    

提交回复
热议问题