Name Normalizer handles suffixes with periods
This commit is contained in:
@@ -12,8 +12,13 @@ namespace MileageTraker.Web.Utility
|
||||
var match = NameRegex.Match(name);
|
||||
if (!match.Success)
|
||||
return name;
|
||||
return string.Format("{0} {1} {2}",
|
||||
match.Groups["First"], match.Groups["Last"], match.Groups["Suffix"]).TrimEnd();
|
||||
var normalizedName = string.Format("{0} {1}", match.Groups["First"], match.Groups["Last"]);
|
||||
if (match.Groups["Suffix"].Success)
|
||||
{
|
||||
var suffix = match.Groups["Suffix"].Value;
|
||||
normalizedName = string.Format("{0} {1}.", normalizedName, suffix);
|
||||
}
|
||||
return normalizedName.TrimEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user