Skip to content

Instantly share code, notes, and snippets.

@cbrevik
Created June 29, 2020 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbrevik/f4081d185e1464ae6537d10746be709b to your computer and use it in GitHub Desktop.
Save cbrevik/f4081d185e1464ae6537d10746be709b to your computer and use it in GitHub Desktop.
int firstDigit = int.Parse(ssn.Substring(0, 1));
int thirdDigit = int.Parse(ssn.Substring(2, 1));
string type = (firstDigit, thirdDigit) switch
{
(8 or 9, _) => "FH",
( >= 4 and <= 7, _) => "D",
  (_, 4 or 5) => "H",
_ => null
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment