Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List - find numeric data and cut it

Status
Not open for further replies.

innu

Programmer
Jun 13, 2001
40
AT
Hi,

I've a list like the following:

BMW, VW, 3, Ford, 27, Toyota, ...


I want to filter out the numbers like 3, 27 and put these numbers into a new variable.

How can I do this?
 
<cfset numericList=&quot;&quot;>
<cfset originlist=&quot;BMW, VW, 3, Ford, 27, Toyota&quot;>
<cfloop index=&quot;i&quot; list=&quot;#originlist#&quot;>
<cfif IsNumeric(i)>
<cfset numericList=ListAppend(numericList, i)>
</cfif>
</cfloop>

<cfoutput>#numericList#</cfoutput> Sylvano
dsylvano@hotmail.com
 
Hi,

thank you very much! It works great!

sl,
Innu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top