Gary - If you are confirmed that the file extension would always have 3
characters and better if its only 'pdf', then see if you can leverage
this code below..
This is just an idea but You probably will have to make a function which
call itself recursively and everytime it will reset the value of string
strToplay for n number of file names..Again this is just an idea and try
to run it in your CF Server and see what it is doing..
If you are getting just two file names you don't even need to create any
recursive function..;-)
---------------------------------------------
<cfset strToplay = "filenameA.pdffilenameB.pdf">
<cfscript>
nameloc = Find(".", strToplay);
//writeoutput(nameloc);
pos1 = nameloc + 4;
pos2 = nameloc + 3;
strbeginfile= MID(strToplay,1,pos2);
writeoutput(strbeginfile);
writeoutput("<br>");
subStrname = MID(strToplay, pos1,len(strToplay));
writeoutput(subStrname);
strToplay = subStrname;
</cfscript>
-----------------------------------------------
Thanks!!
-Sandy Vohra
-----Original Message-----
From: Gary Strommen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 12, 2006 2:17 PM
To: CF-Newbie
Subject: Replace problem... possibly use *
Say I have two file names strung together that comes up similar to this:
filenameA.pdffilenameB.pdf
How would I use the Replace command to remove the second file name? I
figured you could use an Asterik to catch extra characters so my first
thought was to try something like the following:
<cfset fileName = "filenameA.pdffilenameB.pdf">
<cfset strTrunctCERT = #fileName#>
<cfset strTruncatedCERT=#Replace(strTrunctCERT, ".pdf*", ".pdf")#>
<!--note the * -->
<cfoutput>
strTrunctCERT = #strTruncatedCERT#
</cfoutput>
The * does not work. Is there another way to use it?
Thanks!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2051
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15