# need to find item from list

Hi, I need to find 69 from 65 - 72 how can i do, i tried listfind, listcontains, none working
LVL 16
###### Who is Participating?

Commented:
Removing your check fixes it but dont fully appreciate the implications, if any of doing that:

``````function listFindMissing(list)
{
var delim = "-";// list delimiter
var arrToSearch = "";
var i = 0;
var j = 0;
var returnList = "";
if(arrayLen(arguments) GTE 2)
delim = arguments[2];
arrToSearch = listToArray(list, delim);

for(i = ArrayMin(arrToSearch); i LTE arrayMax(arrToSearch); i = i + 1)
returnList = listAppend(returnList, i, delim);

return returnList;
}
``````
0

Commented:

65,66,67,68,69,70,71,72 ??

and you want to check if 69 is in it?

What version of CF are you using?

Tom
0

Web DeveloperAuthor Commented:
i used this function

function listFindMissing(list) {
var delim="-"; // list delimiter
var arrToSearch="";
var i=0;
var j=0;
var returnList="";
if(arrayLen(arguments) GTE 2) delim = arguments[2];
arrToSearch=listToArray(list,delim);
for(i=ArrayMin(arrToSearch);i LTE arrayMax(arrToSearch);i=i+1)
for(j=1;j LTE arrayLen(arrToSearch);j=j+1)
if(arrToSearch[j] EQ i)  break;
else
if (j EQ arrayLen(arrToSearch))
returnList = listAppend(returnList,i,delim);
return returnList;
}

but it is skipping the first and the last letter say

the values are 65-72

it shows me 66,67,68,69,70,71

i need the start and the end too of this
0

Web DeveloperAuthor Commented:
i am on cf 10
0

Web DeveloperAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.