c # string.Empty can represent null character

In C #, if you assign a string to empty string, we generally use the string assignment form "", in fact, in C # string class String class has a special constants to represent string.Empty empty string, this constant can be used directly in the time of the assignment, to write with you "" assign the effect is the same.

For example, we want to assign a null character string strA can use the following method:

string strA="";

string strA=string.Empty;

Effects of the two statements is the same.

Guess you like

Origin blog.csdn.net/generallizhong/article/details/91971744