Как удалить такие дубли из списка C#?
Нам понадобится LINQ
Ход мысли такой:Берем список ссылокКастуем каждую к типу UriЗабираем у каждой левую частьДелаем Distinct колеекцииvar urls = new List<string>() {"https://mysite1.com/", "https://mysite2.com/",
                                           "https://mysite3.com/", "https://mysite4.com/",
                                           "https://mysite1.com/test", "https://mysite2.com/test",
                                          "https://mysite5.com/", "https://mysite5.com/234234/23434/sdfas"};
            
 List<String> uris = urls.Select(x => new Uri(x).GetLeftPart(UriPartial.Authority)).Distinct().ToList();
 uris.ForEach(x => Console.WriteLine(x));
Так ?void Main()
{
	var urls = new List<string>();
	urls.Add("https://mysite1.com/");
	urls.Add("https://mysite2.com/");
	urls.Add("https://mysite3.com/");
	urls.Add("https://mysite4.com/");
	urls.Add("https://mysite1.com/post/168755988566");
	urls.Add("https://mysite2.com/post/168755988566");
	urls.Add("https://mysite3.com/post/168755988566");
	urls.Add("https://mysite4.com/post/168755988566");
	
	var regexPattern = "\\/post\\/\\d*";
	var r = new Regex(regexPattern);
	
	var filteredUrls = urls.Select(x => x).Where(x => !r.IsMatch(x));
	
	foreach (var url in filteredUrls)
	{
		Console.WriteLine(url);
	}
}