VB6 equivalent of string.IsNullOrEmpty

后端 未结 7 1356
野趣味
野趣味 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:22

    The most optimized and safe way to meet your 3 requirements is as follows:

    If LenB(myObj.Str) = 0 
    Then Debug.Print "String is empty/null/not initialized" 
    Else Debug.Print "Not Empty"
    

提交回复
热议问题