c# compare 2 string arrays code example
Example 1: see if two string arrays are equal c#
bool areEqual = a.SequenceEqual(b);
Example 2: c# compare a variable with an array
bool exists = false;
int checkNum;
int[] myNums = new int[10]
for (int i = 0; i < myNums.Length; i++){
if (checkNum == myNums[i]){
exists = true;
}
}
if (exists){
Console.WriteLine("Your number {0} is in the Array.");
}else{
Console.WriteLine("Your number {0} does not match any number in the Array.");
}