You must Sign In to post a response.
  • Category: LINQ

    How to Compare Two list in C#


    Are you looking for a way to compare Two list in C# ? then read this thread to know how to compare it



    string s1 = "umesh bhosale sample code for checking or comparing two list";
    string s2 = "umesh BHOSALE two";

    int icount = s1.ToLower().Trim().Split(' ').ToList().Intersect(s2.ToLower().Trim().Split(' ').ToList()).ToList().Count;
    if (icount >= 1)
    {
    Console.WriteLine("One of the keyword available");
    }
    else
    Console.WriteLine("No keyword available in first list");
  • #742229
    Thans for sharing your valuable code with us, it will really helpful to all members.
    Contribute more to get more. Write a nice article with all your technical stuff and post them in Article section of this website, so that if your article is quality you will be awarded with some Cash credit

    Keep rocking.

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


  • Sign In to post your comments