判断数组相等,该怎么解决
判断数组相等
string[] newarray = new string[sddistance.Length];
public List<string> postive1 = new List<string>();
if ((postive1[key1] == newarray[ii]) && (newarray[ii] != ""))
{
countsentence++;
}

如图一所示,postive1[key1] 和 newarray[ii]都为相同字符“好”,字符相等的时候countsentence应该+1;可是为什么没有进入if相等的语句中呢(结构countsentence是没有加1,)
求大神支招~
------解决思路----------------------
我是不是看到一个空格?、、、
------解决思路----------------------

------解决思路----------------------
奇怪了,我用这个例子发现进入了if判断里面呀
string[] newarray = new string[sddistance.Length];
public List<string> postive1 = new List<string>();
if ((postive1[key1] == newarray[ii]) && (newarray[ii] != ""))
{
countsentence++;
}
如图一所示,postive1[key1] 和 newarray[ii]都为相同字符“好”,字符相等的时候countsentence应该+1;可是为什么没有进入if相等的语句中呢(结构countsentence是没有加1,)
求大神支招~
------解决思路----------------------
------解决思路----------------------
------解决思路----------------------
static void Main(string[] args)
{
string[] sddistance = new string[210];
string[] newarray = new string[sddistance.Length];
List<string> postive1 = new List<string>();
for (int i = 0; i <= 209; i++)
postive1.Add("Hao");
int ii = 5; int countsentence = 0;
newarray[ii] = "Hao";
if ((postive1[209] == newarray[ii]) && (newarray[ii] != ""))
{
Console.WriteLine(postive1[209]);
Console.WriteLine(newarray[ii]);
countsentence++;
}
}
奇怪了,我用这个例子发现进入了if判断里面呀