Best way to compare 2 urls [closed]
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I want to compare 2 URLs. Whats the best way to do this? Conditions: 1) It should exclude the http scheme. 2) 'foo.com/a/b' and 'foo.com/a' should be a match. 回答1: You should use the Uri.Compare method. Here is an example to compare two URI's with different schemes. public static void Test() { Uri uri1 = new Uri