Stop my madness & help me with two lists

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Stop my madness & help me with two lists

    I have 2 lists.
    List1 is a,b,c,d
    List2 is a,b,e,f,g,h,i
    I want to make a third list. The third list should be all items in List2 that
    are not in List1. What is the best way to do this. I have been stumbling with
    it for hours.

    ccsimmons Guest

  2. Similar Questions and Discussions

    1. STOP=Save The Opticles People! ... Stop Flashs flashing!
      :| WHEN will they ever learn, our eyes are not to be played with. Imagin putting on a blindfold on for 1 - 24hr period & TRY to go about there...
    2. Array MADNESS
      Have I gone crazy? <cfscript> arr=arrayNew(2); arr = 'Col 1 Row 1'; arr = 'Col 1 Row 2'; arr = 'Col 2 Row 1'; arr = 'Col 2 Row 2'; arr = 'Col...
    3. Madness, I call it madness
      Maybe it's me who is mad but... I have a windows application with a datagrid. On pressing F5 (when the grid or any grid's cell has a focus) I...
    4. flv -&gt; swf madness
      i've created a flv from a quicktime movie and exported it out as a swf then i load that swf into a movieclip and everything works fine except that...
    5. lists, attaching behaviour dynamiclly, update lists
      Hello, I am trying to get these scripts to work correctly. What I am trying to do is: 1) Look into a folder called 'tank,' then when this is...
  3. #2

    Default Re: Stop my madness & help me with two lists

    Here you go!

    <cfset List1 = "a,b,c,d">
    <cfset List2 = "a,b,e,f,g,h,i">
    <cfset List3 = "">

    <cfloop list="#List2#" index="i">
    <cfif NOT ListFindNoCase(List1, i)>
    <cfset List3 = ListAppend(List3, i)>
    </cfif>
    </cfloop>

    <cfoutput>#List3#</cfoutput>

    Stressed_Simon Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139