Adobe Dreamweaver Forums



Last 10 THreads :         Temporary files of Flash 10 (Last Post : Johnny Grows - Replies : 0 - Views : 1 )           »          Temporary files of Flash 10 (Last Post : Johnny Grows - Replies : 0 - Views : 1 )           »          Final Resolution to the FW CS4 Install Problem (Last Post : Marje - Replies : 0 - Views : 1 )           »          Re: Screen readable output (section 508) (Last Post : Author care - Replies : 0 - Views : 1 )           »          Window Menu (Last Post : c-bread24 - Replies : 0 - Views : 1 )           »          Direct language translation (Last Post : sha661 - Replies : 7 - Views : 8 )           »          Flash Water Fountain Effect (Last Post : NedWebs - Replies : 1 - Views : 2 )           »          Problems handling xml data for tree control. (Last Post : gallaharsha - Replies : 1 - Views : 2 )           »          Anyone know why I can't refer to a label control(id="address") in the component I created? (Last Post : SujitG - Replies : 1 - Views : 2 )           »          Flash CS4 External Lirbrary (Last Post : Federico Rivas Corrales - Replies : 0 - Views : 1 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Cold Fusion
 
Tags: , ,



Reply
  #1 (permalink)  
Old 07-24-2008, 02:56 PM
dmorand17
 
Posts: n/a
Diggs:
Default String split function?

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.



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-24-2008, 03:29 PM
GArlington
 
Posts: n/a
Diggs:
Default Re: String split function?

On Jul 24, 2:36 pm, "dmorand17" <webforumsu...@macromedia.com> wrote:
> 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.


GetFileFromPath()? Or ListGetAt()? (see CF docs)
Reply With Quote
  #3 (permalink)  
Old 07-24-2008, 05:39 PM
Dan Bracuk
 
Posts: n/a
Diggs:
Default Re: String split function?

ListLast will work.
Reply With Quote


  #4 (permalink)  
Old 07-24-2008, 06:10 PM
satheesh_p
 
Posts: n/a
Diggs:
Default Re: String split function?

Hi
As dan rightly said you use listlast function as explained below.

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

Thanks,
Satheesh.

Reply With Quote
  #5 (permalink)  
Old 07-24-2008, 06:10 PM
dmorand17
 
Posts: n/a
Diggs:
Default Re: String split function?

That worked like a charm! Thanks guys!!!!
Reply With Quote
  #6 (permalink)  
Old 07-24-2008, 07:41 PM
Ian Skinner
 
Posts: n/a
Diggs:
Default Re: String split function?

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.
Reply With Quote


  #7 (permalink)  
Old 07-25-2008, 02:05 PM
larryclyons
 
Posts: n/a
Diggs:
Default Re: String split function?

On Jul 24, 9:36*am, "dmorand17" <webforumsu...@macromedia.com> wrote:
> 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.


While what you want is the getFileFromPathFunction() or listLast
functions, since CF is built on J2EE you also have native access to a
lot of the Java functions. ColdFusion strings are Java Strings
internally, which means they are an Object of class
“java.lang.String” . So you can use the string object functions
including the split method as in foo.split(). For instance, arrSplit =
myStr.split("i"); will return an array (split by the letter 'i').

hth,
larry
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 01:43 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk