因为并没有对test[5]进行初始化,所以是null. string[] test = new string[100];
int i;
for (i=0;i<5;i++)
{
test[i] = "abc";
}
if (test[5]  ==  null)
{
MessageBox.Show("Null");
}

解决方案 »

  1.   

    因为并没有对test[5]进行初始化,所以是null. string[] test = new string[100];
    int i;
    for (i=0;i<5;i++)
    {
    test[i] = "abc";
    }
    if (test[5]  ==  null)
    {
    MessageBox.Show("Null");
    }
      

  2.   

    ""和null是两个概念,""表示空串,null表示未引用
      

  3.   

    同意楼上的论述。你的问题类似于
    string s = null;if( s = "" ) // todoGood Luck!
      

  4.   

    所以应该这么判断 if (s = null) then //todo