just curious but what if someone passes in a ssn that is already
formated 123-45-6789
it isn't just nine characters, it is a valid ssn, it is the actual
expected output.

It doesn't seem to me that this really violates the contract - and
throwing an exception would be an unwanted result.

based on my understanding of the problem your trying to solve it seems
that if the ssn is not in the format 123456789 or 123-45-6789 then you
should throw an exception.  If you get it in either of these two
formats then you should either format it (if needed) and return the
validly formatted ssn.

personally, I would probably have two functions - one that formats a
SSN and one that masks a ssn (xxx-xx-6789)



-- 
Bill
http://blog.rawlinson.us
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at 
[EMAIL PROTECTED]

Reply via email to