Get intersection of 2 string arrays

Diego Alvarez 101 Reputation points
2022-04-23T22:12:05.133+00:00

Hello. I try to get the intersection of 2 string arrays using an implementation of IEqualityComparer. But for some reason the Equals method is not executed. I put a breakpoint but the execution doesn't stop there. Do you know the reason? Thank you. I attach the code.

195871-imagen001.png

195805-imagen002.png

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,306 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,580 questions
0 comments No comments
{count} votes

8 answers

Sort by: Most helpful
  1. Andriy Bezkorovayny 6 Reputation points
    2022-04-24T11:39:11.377+00:00

    @Diego Alvarez I provided you with two snippets, see the urls to DotNetFiddle, the second one contains the comparer created by you and I see it works properly.
    If it doesn't work for you please share more code, explain the way of how did you check the solution and I hope I will help you to get the code working on your side.

    0 comments No comments

  2. Diego Alvarez 101 Reputation points
    2022-04-24T13:29:52.813+00:00

    andriyb, there is no more related code.


  3. Diego Alvarez 101 Reputation points
    2022-05-04T12:43:18.51+00:00

    Thank you but I did the method manually and it works for me.

    0 comments No comments