What is the difference between vbNullString, String.Empty and “”?
问题 All of these txtUsername.Text <> vbNullString txtUsername.Text <> String.Empty txtUsername.Text <> "" seem to return the same result. So, what's the difference between vbNullString , String.Empty and "" ? 回答1: vbNullString is a constant, more likely out of VB6, String.Empty and "" are the same, some say that there is a performance difference, but that is not true, it is your choice what you use. To check whether a string is empty you can use If String.IsNullOrEmpty(String) . The advantage is