Skip to main content
Known Participant
July 24, 2008
공지사항

String split function?

  • July 24, 2008
  • 2 답변들
  • 746 조회
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.
    이 주제는 답변이 닫혔습니다.

    2 답변

    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.
    dmorand17작성자
    Known Participant
    July 24, 2008
    That worked like a charm! Thanks guys!!!!
    Inspiring
    July 24, 2008
    ListLast will work.