RosettaCodeData/Task/Empty-string/VBA/empty-string.vba

15 lines
314 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
dim s as string
' assign an empty string to a variable:
s = ""
' test if a string is empty:
if s = "" then Debug.Print "empty!"
' or:
if Len(s) = 0 then Debug.Print "still empty!"
'test if a string is not empty:
if s <> "" then Debug.Print "not an empty string"
'or:
if Len(s) > 0 then Debug.Print "not empty."