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] =
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
Hi Claude
There is also a Java function that may work for you:
cfset num = 12345678901
cfset digits = num.toCharArray()
However this does not return a normal CF array, this is a Java array of
Character objects. If you want to manipulate the digits you'd probably want
to convert to a normal cf
Or do it in the query ...
Oracle would be something like ...
SELECT substr(your_column_here, 1, 1) AS COL1,
substr(your_column_here, 2, 1) AS COL2,
substr(your_column_here, 3, 1) AS COL3,
substr(your_column_here, 11, 1) AS COL11
FROM your_table_here
Not that I am recommending it ... I'm