It seems to me, as a list, that your delimiter is a hyphen, not a dollar
symbol
 
trim(listlast(theXMLdata, '-'))

or if you don't want the dollar symbol...

replace(trim(listlast(theXMLdata, '-')), '$', '')

or a regex to grab everything after the $ (if you can guarantee no other
dollar symbols)

val(rereplace(theXMLdata, ".*?\$(.*?)", "\1"))

..:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com



-----Original Message-----
From: Che Vilnonis [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 05, 2008 3:59 PM
To: CF-Talk
Subject: String Manipulation Fun

Take the following xml string value:
        1969 Chevrolet Camaro - Windsor, ON N8W 5J1 - $44900

I use the following code to extract and set the price:

<cfif findNoCase("$", theArray[i].description.xmlText)>
        <cfset price = listlast(theArray[i].description.xmlText, "$")>
</cfif>

Sometimes though, the xml data is incomplete and looks like this:
        1969 Chevrolet Camaro - Windsor, ON N8W 5J1 - $

My current logic bombs on the listlast statement. Any ideas how to fail
gracefully and set the price to zero when this happens?

Thanks, Che




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298275
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to