W
web1110
I have an array of of 5 string elements. I put values in 3 of them. Yet
when I loop over them, I do not catch the empty string. The code output
below does not include "Empty"
string[]x=new String[5];
x[0]="111";
x[1]="222";
x[2]="333";
string msg="";
for(int i=0;i<x.Length;i++)
{
if(x==String.Empty)
{
msg+=msg+"Empty\n";
}
else
{
msg=msg+x+"\n";
}
}
MessageBox.Show(msg);
when I loop over them, I do not catch the empty string. The code output
below does not include "Empty"
string[]x=new String[5];
x[0]="111";
x[1]="222";
x[2]="333";
string msg="";
for(int i=0;i<x.Length;i++)
{
if(x==String.Empty)
{
msg+=msg+"Empty\n";
}
else
{
msg=msg+x+"\n";
}
}
MessageBox.Show(msg);