Microsoft MVP, MCP, MCAD, MCTS, MCPD and MCT
besides the obvious WTF,
does VB evalate all of the conditions in the or?
because C# stops when it reaches the first true.
so if
str is Nothing and VB evaluates them all
then Len(str) = 0 will throw an exception.
won't it?
Hello Mladen,
VB.NET has a short-circuit operator: OrElse and AndAlso, so in OrElse case, if the first condition is True, the second is not evaluated. But all conditions in above code are making the same verification.
If you need to test thenstring value, you only need to use the static method IsNullOrEmpty of String class.
Thanks for comment.