Basically, I need to create a method that will do its darn best to take a name field and split it into title, firstNames and lastNames.
E.g. Mr. Daniel George Trump will become:
Title: Mr.
FirstNames: Daniel George
LastNames: Trump
or
Mr. Daniel George Trump and Mrs. Sarah Trump will become:
Title: Mr and Mrs
FirstNames: Daniel George & Sarah
LastNames: Trump & Trump (some inputs may be two people with different surnames).
Thanks
You might make a list of standard titles (Mr., Mrs., etc.) and try to match any of those. Then for two-word names, use the first as the first name and the second as the last name. For longer names, maybe use the first two words as the first name and the rest as the last.