Dump Rupesh's array, and you'll see an item "damon". Dump your array, and you WON'T see an item "_1thumb.jpg". You will (or at least should) see items that contain that substring, but none that are exactly that string.
Charlie's suggestion was right, my original one was a red herring. cheers, barneyb On Jan 8, 2008 11:39 AM, Janet MacKay <[EMAIL PROTECTED]> wrote: > >Charlie/Barney, I've simplified things a bit and changed the code to read > >"indexOf". Take a look at the both versions of code below. The version of > >Rupesh's code works, yet my version does not. Since his code does work, I > >*should* be able to find the value substring in an array of strings using > >this method. Any ideas what might be wrong? > > > >---Rupesh's Sample Code--- > ><cfset y = ListToArray("rupesh,tom,damon,hemant,ashwin,ram,prank,sanjeev")> > ><cfset pos = y.indexOf("damon") + 1> > > > ><cfoutput> > >Index of damon: #val(y.indexof("damon") + 1)#<br> > >Value of index: #y[pos]#<br> > ></cfoutput> > > > ><p></p> > ><cfdump var="#y#"> > > > ><br><hr width="100%" size="1" noshade><br> > > > >---My Sample Code--- > ><cfhttp url="http://ww2.collectorcartrader.com/details.php?adId=90177579" > >method="get"> > > > ><cfset images = reMatchNoCase("<img([^>]*[^/]?)>",cfhttp.FileContent)> > ><cfset pos = images.indexOf("_1thumb.jpg") + 1> > > > ><cfoutput> > >pos = #pos#<br> > >image src = #images[pos]#<br> > ></cfoutput> > > > ><p></p> > ><cfdump var="#images#"> > -- Barney Boisvert [EMAIL PROTECTED] http://www.barneyb.com/ Got Gmail? I have 100 invites. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296179 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4