Connecting Tech Pros Worldwide Forums | Help | Site Map

How can I use ListDeleteAt on a dotted comma separated list?

Haitashi's Avatar
Member
 
Join Date: Jun 2007
Location: Orlando, FL
Posts: 94
#1: Mar 2 '09
I have a comma delimited list of the following elemente:
sites.app.enroll.page5.degrees.gfdg,
sites.app.enroll.page5.degrees.aeetr,
sites.app.enroll.page5.degrees.sfdsd,
sites.app.enroll.page5.degrees.ur4gf,

I'd like to use the "listDeleteAt" function to take that list and remove everything after "degrees". Any ideas? I that this but it doesn't seem to work correctly. I still get all the text after the "degree."

Expand|Select|Wrap|Line Numbers
  1. <cfset temp = valueList(this.RecordSet.node_base) />
  2. <cfset Variables.nodeList = ListDeleteAt(temp, "6") />
this.recordset.node_base contains the list.

Thanks!

Haitashi's Avatar
Member
 
Join Date: Jun 2007
Location: Orlando, FL
Posts: 94
#2: Mar 2 '09

re: How can I use ListDeleteAt on a dotted comma separated list?


I figured it out. I have to do it this way. Adding the delimiter as part of my second argument:

Expand|Select|Wrap|Line Numbers
  1. <cfset Variables.nodeList = ListDeleteAt(this.RecordSet.node_base, listLen(this.RecordSet.node_base, "."), ".") />
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#3: Mar 4 '09

re: How can I use ListDeleteAt on a dotted comma separated list?


That's correct, but you could've used ListLast(). See List functions.
Reply

Tags
coldfusion, listdeleteat