tags:

views:

102

answers:

1

Hi, I got a problem in using listfind().

I have a list of strings.One of my string has a comma.

Now when i use listfind() to compare with another string I dont get the output expected. i.e The string with a comma in it is not detected.

Please can anyone tell me how to make the listfind to work even for the string having comma in it ?

+8  A: 

The default delimiter for all CF functions is the comma. In order to use strings with commas you must change the delimiter.

For example:

ListAppend(list, "A value, with comma", "^")
ListFind(list, "A value, with comma", "^")
Jeff Price
It's worth noting that the delimiter needs to be what the list uses - you can't put any character and assume the function will do magic.I suspect the OP wants to deal with quoted/escaped commas, rather than changing the delimiter, but I guess we need to wait for more information from them.
Peter Boughton
IMHO if question is related to listFind method then this is the right answer. If question was about something else you could post an answer with for example REMatch or whatever...
zarko.susnjar
We don't know what the question is about; not enough information has been given. I can't give a REMatch solution for an unspecified problem.
Peter Boughton
Hi, My question is related to listfind method. Before using list find i am using valuelist function.As suggested by jeff i can change the delimiter in valuelist to a "^" and use the same delimiter in the listfind method.Thanks all.
Somu