I want the output like this :
A=1
C=3
D=9
e=5
If second array value is 0 I don't want that value how to achieve this output in c#?
private static void Main(string[] args)
{
string[] a = new string[] { "a", "b", "c", "d" ,"e"};
string[] b = new string[] {1,0,3,0,5 };
foreach (string tmp in a)
{
bool existsInB = false;
foreach (string tmp2 in b)
{
if (tmp == tmp2)
{
existsInB = true;
break;
}
}
if (!existsInB)
{
Console.WriteLine(string.Format("{0} is not in b", tmp));
}
}
Console.ReadLine();
}
In that two arrays I want to print values like a=1,c=3,e=5, I don't want to print second array zero value. How do I achieve this?
I need a output in c#: a=1 c=3 e=5