Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

String split function?

New Here ,
Jul 24, 2008 Jul 24, 2008
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.
688
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 24, 2008 Jul 24, 2008
ListLast will work.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 24, 2008 Jul 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 24, 2008 Jul 24, 2008
That worked like a charm! Thanks guys!!!!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 24, 2008 Jul 24, 2008
LATEST
dmorand17 wrote:
> That worked like a charm! Thanks guys!!!!

Just in case you want something different there are is the
fileFromPath() function as well. But I'm not sure why this would be better.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources