Failed to compare two elements in the array

前端 未结 5 2049
滥情空心
滥情空心 2020-12-11 00:01

I have a List where T is a class that exposes a \"Username\" property. Username is of a custom type that encapsulates a string. I implemen

5条回答
  •  温柔的废话
    2020-12-11 00:11

    In my case, I added a try/catch block inside the Compare function, and displayed the exception Message to the console. If there is a bug inside your compare function, you will get this secondary exception ("Failed to compare two elements...").

    My problem was specifically with indexing to position 3 of a string that was "" due to another bug.

提交回复
热议问题