<cfset url = "http://www.foobar.com/images/screwy.gif";>
<cfset myURL = listGetAt(url,1,'/') & "//" & listGetAt(url,2,'/')>
<cfoutput>#myURL#</cfoutput>

This code will do it.  You can use the "/" as list delimiters, in which
you're just grabbing the first two items in the list into a variable.

Keep in mind that you're not using the 1st and 3rd item in the list because
ColdFusion doesn't include empty list items in its count.

Eric


-----Original Message-----
From: Tim Claremont [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 3:00 PM
To: CF-Talk
Subject: String Manipulation help needed


I have the following string:

http://www.foobar.com/images/screwy.gif

I want to return everything before the third /

In other words, I want to retrieve the following:

http://www.foobar.com


I am sure there is a simple string function. What am I missing?

T


______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to