I am using 3rd party library to obtain data from a machine's variable. The data returns a string type, so after requesting data I'm validating that it is not an empty string like that:
Not String.IsNullOrWhiteSpace(data) However, my program was failing, and I realized that when the variable in the machine was empty, the function above was returning True.
By debugging I noticed that the function in the 3rd party library returns vbNullChar when the variable is empty and String.IsNullOrWhiteSpace(vbNullChar) evaluates to False, when I would expect it to evaluate to True as String.IsNullOrWhiteSpace(vbNullString) does.
So is my only option to check as follows?
Not String.IsNullOrWhiteSpace(data) AndAlso data <> vbNullChar
nullreference nor an empty string? It is a string that contains 1 character, the\0code.