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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Haitashi
    New Member
    • Jun 2007
    • 96

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

    I have a comma delimited list of the following elemente:
    sites.app.enrol l.page5.degrees .gfdg,
    sites.app.enrol l.page5.degrees .aeetr,
    sites.app.enrol l.page5.degrees .sfdsd,
    sites.app.enrol l.page5.degrees .ur4gf,

    I'd like to use the "listDelete At" 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."

    Code:
    <cfset temp = valueList(this.RecordSet.node_base) />
    <cfset Variables.nodeList = ListDeleteAt(temp, "6") />
    this.recordset. node_base contains the list.

    Thanks!
  • Haitashi
    New Member
    • Jun 2007
    • 96

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

    Code:
    <cfset Variables.nodeList = ListDeleteAt(this.RecordSet.node_base, listLen(this.RecordSet.node_base, "."), ".") />

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

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

      Comment

      Working...