VB6 equivalent of string.IsNullOrEmpty

后端 未结 7 1428
野趣味
野趣味 2020-12-29 20:40

I\'m doing some work on a legacy application, and my VB6 skills aren\'t that great. I need to check whether a String field has been initialized and set to something other th

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 21:05

    VB6 was designed to be easy

    Use

    If str = "" Then 
      ' uninitialised, null or empty ""
    
    • Strings are automatically initialized to [edit] a null string.
    • The null string is vbNullString.
    • But don't worry about null strings. A VB6 null string is indistinguishable from an empty string "" for (almost) any string manipulation.

提交回复
热议问题