thats a lot of work for not much
 
-- Make it into a list
<cfset list = REReplace("12345678901", "([0-9])", "\1,", "ALL") />
 
-- Make it into an array (CF8 only)
<cfset list = REMatch("[0-9]", "12345678901") />
 
or
 
<cfset list = listToArray(REReplace("12345678901", "([0-9])", "\1,", "ALL"))
/>
 
Even the example below....why wouldnt you just use MID() ?
 
 <cfset numberStruct[i] = MID(number, i, 1) />
 
Steve


  _____  

From: Paul Kukiel [mailto:kuki...@gmail.com] 
Sent: Tuesday, 8 September 2009 1:40 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: FW: string manipulation



How about this:

 

<cfset number = "12345678912" />

<cfset numberStruct = {} />

<cfloop from="1" to="#len(number)#" index="i">

      <!--- display --->

      <cfoutput>

            #left(right(number,len(number)-i+1),1)#

      </cfoutput>

      <!--- make varibales --->

      <cfset numberStruct[i] = left(right(number,len(number)-i+1),1) />

</cfloop>

 

<cfdump var="#numberStruct#" />

 

Paul.

 

From: SAMARIS Software [mailto:i...@samaris.net] 
Sent: Tuesday, 8 September 2009 1:27 AM
To: 'cfaussie@googlegroups.com'; 'coldfusion-ho...@yahoogroups.com'
Subject: string manipulation 

 

I have many records that have an 11 digit number stored into one database
field however I am wanting to break up the value to display as 11 separate
values so I am wondering how do I separate the 11 digit value into 11
separate values in cold fusion

 

 

 

Regards 

Claude Raiola 
B.Econ (Acc), B.Hot.Mngt. 

Websites: 

 <http://www.samaris.net> www.SAMARIS.NET 

Mobile: 0414 228 948

 





 





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to