Assuming surnames is required, the following result was found.
// // Names starting with Mc, O', D', I' l_ExceptionPrefixes = {"Mc", "O'", "D'", "I'"}; // // deal with double barrelled surnames l_FormattedLastName = List(); l_LastNameParts = v_LastName.toList("-"); for each v_LastNamePart in l_LastNameParts { // //...