I have seen a few posts on here which get the initials of a “John Doe” but I am looking for a way to extra initials for some results of email addresses which from MS Graph API which have the following results:
"John Doe"
"Doe, Josh"
"John, Doe (DHS)"
"John Doe Phd"
"John"
Outlook will return the following translations as initials
"John Doe" => JD
"Doe, Josh" => DJ
"John, Doe (DHS)" => JD
"John Doe Phd" => JD
"John" => J
I would like to copy how outlook does it but its unclear how to account for each combination. It seems regex might be too complex for this?