> I am currently working with an exported set of data, one of 
> the fields contains social security numbers.  Currently when 
> I input the data it puts in the whole SSN.  I was wondering 
> if there was a way to replace the first 5 numbers with X and 
> leave the last 4 numbers alone.  ie: 123-45-6789 would become 
> XXX-XX-6789. 
> 
> This is purely for security reasons.  I thought about using 
> the mask function, but if I recall that would just be used to 
> validate that the SSN was formatted right.  I also thought 
> about using the replace function, but I have no clue where I 
> would start there.

You don't need to do anything fancy for this:

<cfset sanitizedSSN = "XXX-XX-" & Right(SSN, 4)>

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263237
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to