Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. Except and two List<string> comparison question</string>

Except and two List<string> comparison question</string>

Scheduled Pinned Locked Moved LINQ
questioncsharpcomtoolstutorial
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Programm3r
    wrote on last edited by
    #1

    Hi all, I am trying to compare two List. I only want the values that the other one does not have. For example:

    List 1
    123
    456
    789
    495

    List 2
    123
    564
    456
    458

    I have tried the following with no result: listOne.Distinct().Except(listTwo.Distinct()); Many thanks in advance Kind regards,

    The only programmers that are better C# programmers, are those who look like this -> :bob:

    :)Programm3r My Blog: ^_^

    P 1 Reply Last reply
    0
    • P Programm3r

      Hi all, I am trying to compare two List. I only want the values that the other one does not have. For example:

      List 1
      123
      456
      789
      495

      List 2
      123
      564
      456
      458

      I have tried the following with no result: listOne.Distinct().Except(listTwo.Distinct()); Many thanks in advance Kind regards,

      The only programmers that are better C# programmers, are those who look like this -> :bob:

      :)Programm3r My Blog: ^_^

      P Offline
      P Offline
      Programm3r
      wrote on last edited by
      #2

      Hi all, Nevermind ... stupid mistake ... never took the spaces out of the second List :omg: :wtf:

      The only programmers that are better C# programmers, are those who look like this -> :bob:

      :)Programm3r My Blog: ^_^

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups