Skip to main content
Known Participant
July 24, 2008
Question

String split function?

  • July 24, 2008
  • 2 replies
  • 746 views
I'm trying to find a string split function but can't seem to find one.

I'm trying to retrieve just the filename from a path ..... for example:

D:\CFusionMX7\runtime\servers\coldfusion\SERVER-INF\temp\wwwroot-tmp\neotmp40892.tmp

I want to retrieve only the "neotmp40892.tmp" so I can save that to a variable.
    This topic has been closed for replies.

    2 replies

    Inspiring
    July 24, 2008
    Hi
    As dan rightly said you use listlast function as explained below.

    <cfset filename="D:\CFusionMX7\runtime\servers\coldfusion\SERVER-INF\temp\wwwroot-tmp\neotmp40892.tmp">
    <cfoutput>
    #listlast(filename,"\")#
    </cfoutput>

    Thanks,
    Satheesh.
    dmorand17Author
    Known Participant
    July 24, 2008
    That worked like a charm! Thanks guys!!!!
    Inspiring
    July 24, 2008
    ListLast will work.