The following is less code but would it execute slower because of the mid?
I can't test right now.

<cfset myString = "This is funner" />
<cfloop from="1" to="#len(myString)# index="x">
       <cfoutput>Position #x# = #mid(myString,x,1)#<br/></cfoutput>
</cfloop>

On Thu, Sep 23, 2010 at 9:28 PM, Rick Root <[email protected]> wrote:

>
> <Cfset mySTring = "This is fun">
> <cfset myArray = mySTring.split('')>
> <cfloop from="1" to="#ArrayLen(myArray)#" step="1" index="x">
>        <cfoutput>Position #x# = #myArray[x]#<br/></cfoutput>
> </cfloop>
>
> Yes, it's THAT easy.  If you run the code above you'll see this:
>
> Position 1 =
> Position 2 = T
> Position 3 = h
> Position 4 = i
> Position 5 = s
> Position 6 =
> Position 7 = i
> Position 8 = s
> Position 9 =
> Position 10 = f
> Position 11 = u
> Position 12 = n
>
> Note that the first element is an empty string.
>
> Rick
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337442
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to