i have a bunch of text and list1 which has 5 strin...
# cfml-beginners
g
i have a bunch of text and list1 which has 5 strings i want to check and a replacement list which is only 1, i tried replacelist but that does not seems to be working well https://trycf.com/gist/39e7ebb8ede48054c09ecad24b4bd8e6/lucee5?theme=monokai
a
Are you trying to replace any of these:
'This,Creator,visiblity,pool
with
pool
in the string?
Can you given an example of what you want the output to be?
v
Copy code
<cfset x = replacelist(data,'This,Creator,visiblity,pool','pool,pool,pool,pool')>
2nd & 3rd argument for
replaceList
is also a list which is 1-1 mapped
g
i do not know if the pool will be in the text data, but it could beeither pool or visible or this or creator, i want to replace the one i find from list1 with list2
s
if your always replacing it with just a single value you can use regex https://trycf.com/gist/d9759d58060e70732cefb8f9ed0c092a/lucee5?theme=monokai