« ASP中isNull(str)、isEmpty(str)、str =""的区别
获取当前系统时间 »

ASP常用函数:IsBlank()

'==============================
'判断是否为空
'==============================

Function IsBlank(TempVar)
IsBlank = False
Select Case VarType(TempVar)
'Empty & Null
Case 0, 1
IsBlank = True

'String
Case 8
If Len(TempVar) = 0 Then
IsBlank = True
End If

'Object
Case 9
Dim tmpType
tmpType = TypeName(TempVar)
If (tmpType = "Nothing") Or (tmpType = "Empty") Then
IsBlank = True
End If

'Array
Case 8192, 8204, 8209
If UBound(TempVar) = -1 Then
IsBlank = True
End If
Case Else
IsBlank = True
End Select
End Function
  相关文章:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。