<cfset myNumbers = "">
<cfloop from="1" to="#len(myAlphaNumString)#" index="i">
<cfif len(myNumbers) LT 3>
<cfif isNumeric(mid(myAlphaNumString, i, 1)>
<cfset myNumbers = myNumbers & mid(myAlphaNumString, i, 1)>
</cfif>
</cfif>
</cfloop>
Adrian Cesana writes:
> I need to pull the left most 3 numeric digits from an alphanumeric string,
> anyone have a good method of doing this?. The string could also have other
> character in it like "#$,' etc...
>
> I was thinking this possibly could be done with LEFT() and REREPLACE()...
>
> Thanks,Adrian
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com