The code I have to determine how many are the same:

char[] charArray1 = playerOne.ToCharArray(); char[] charArray2 = playerTwo.ToCharArray(); bool hasCommonElements = charArray1.Intersect(charArray2).Count() > 0; char[] commonElements = charArray1.Intersect(charArray2).ToArray(); Console.WriteLine("You have " + commonElements.Length + " number(s) right.");

This does exactly, what I need it to, because I don't really care about which elements are the same, just how many there are. I figure this method would work for determining how many are in the correct position as well, but I can't find any information about making it so the order matters. If anyone has any advice, I'd really appreciate it. Thank you.