VB6: Sample Code for empty string and null string


Public Function IsEmptyString(ptr As String) As Boolean
'
' Reference:
' (1) http://experts.about.com/q/1048/4041275.htm
' (2) Chapter 6: Strings, Win32 API Programming with Visual Basic, Steven Roman, O'Reilly & Associates, Inc.
' [It can be found at MSDN.]
'
IsEmptyString = StrPtr(ptr) <> 0 And Len(ptr) = 0
End Function

Public Function IsNullString(ptr As String) As Boolean
'
' Reference:
' (1) http://experts.about.com/q/1048/4041275.htm
' (2) Chapter 6: Strings, Win32 API Programming with Visual Basic, Steven Roman, O'Reilly & Associates, Inc.
' [It can be found at MSDN.]
'
IsNullString = StrPtr(ptr) = 0
End Function