<cfset randomCharacters = '0123456789abcdefghijklmnopqrstuvwxyz' /> <cfset randomString = '' />
<cfloop from="1" to="4" index="i"> <cfset randomNumber = RandRange(1,LEN(randomCharacters)) /> <cfset randomString = randomString & MID(randomCharacters,randomNumber,1) /> </cfloop> -Jake On Wed, Feb 10, 2010 at 12:50 PM, Les Irvin <les.cft...@gmail.com> wrote: > > How would I come up with a 4-character random string consisting of any > letter or number? > 1k3d, e4rf, 69e4, dfje, 3967, etc... > > Thanks in advance for your help, > Les > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330555 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4