An empty string is a zero length string, a string that is equal to null (""), or not assigned. In some languages, you can check if a string is empty by comparing it to an empty string (""). Some languages distinguish between nil and null ("") so checking if the length is 0 is easier.
VB.Net Empty String Check
In .Net, a string can be null or empty. The .Net framework offers a static method in the string class: String.IsNullOrEmpty to check if a string is null or empty.
Syntax Example:
Dim s As String
's = "" 'Uncomment to test 2nd case.
If String.IsNullOrEmpty(s) Then MessageBox.Show("hello") End If
The following are practice certification questions with answers highlighted. These questions were prepared by Mike Prestwood and are intended to stress an important aspect of this KB post. All our practice questions are intended to prepare you generally for passing any certification test as well as prepare you for professional work.