Know the answer? Post it. Somebody with the same question will find it here.
Saillesh PawarRank #537 · 4.5K pointsPosted Mar 11, 2016, 5:13 AM EST
0
I hope this will help.
C#
{
string a = "01011";
string b = "10110";
//converting into char arraychar[] charArrayA = a.ToCharArray();
char[] charArrayB = b.ToCharArray();
//logic for comparing the each elements with both the arraysfor(int i=0;i<charArrayA.Length;i++)
{
if (charArrayA[i] == charArrayB[i])
{
Console.WriteLine("Match found at location "+(i+1));
}
}
Console.ReadLine();
}
Saillesh PawarRank #537 · 4.5K pointsPosted Mar 11, 2016, 5:13 AM EST
{ string a = "01011"; string b = "10110"; //converting into char array char[] charArrayA = a.ToCharArray(); char[] charArrayB = b.ToCharArray(); //logic for comparing the each elements with both the arrays for(int i=0;i<charArrayA.Length;i++) { if (charArrayA[i] == charArrayB[i]) { Console.WriteLine("Match found at location "+(i+1)); } } Console.ReadLine(); }