----- Original Message ----- 
From: "Will Tomlinson" <[EMAIL PROTECTED]>
To: "CF-Talk" <cf-talk@houseoffusion.com>
Sent: Saturday, April 28, 2007 2:54 PM
Subject: How can I check this string a different way?


>I need a better way to evaluate a string here. Maybe a regex I guess?
>
> I have a hyphen-delimited list. The last item in the list needs to be 
> flagged if it contains OL1, OL2, etc.
>
> Just if it contains the OL at all, I need to flag it as an online 
> course.
>
> Here's what I'm using now, what's a better way to handle it?
>
> <cfif ListLast(getSection.section, "-") CONTAINS "OL">
> <cfset isOLCourse = true>
> </cfif>


<cfset isOLCourse = Left(ListLast(getSection.section, "-"), 2) is "OL"> 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

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

Reply via email to