PA Licence
jmf8883 opened this issue · comments
jmf8883 commented
Your code would not parse the name element on a PA license correctly. I have attached a sample PA license and the code I used to parse the name.
case "DAA":
var names = data.Split(',', '$');
if (names.Length == 1)
{
var namesSpaces = data.Split(' ');
FirstName = namesSpaces[0].Trim().ReplaceEmptyWithNull();
if (namesSpaces.Length == 2)
{
LastName = namesSpaces[1].Trim().ReplaceEmptyWithNull();
MiddleName = null;
}
else
{
LastName = namesSpaces[namesSpaces.Length-1].Trim().ReplaceEmptyWithNull();
MiddleName = String.Join(" ", namesSpaces.Skip(1).Take(namesSpaces.Length - 2)).ReplaceEmptyWithNull();
}
}
else
{
LastName = names.Length > 0 ? names[0].Trim().ReplaceEmptyWithNull() : null;
FirstName = names.Length > 1 ? names[1].Trim().ReplaceEmptyWithNull() : null;
MiddleName = names.Length > 2 ? names[2].Trim().ReplaceEmptyWithNull() : null;
}
break;
Connor O'Shea commented
Thanks! Pennsylvania doesn't follow the AAMVA 2000 standard exactly but I added code in ac1bea3 to accommodate it. It will be in the upcoming v4 release.