OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Getting initials from non standard email API using Javascript

  • Thread starter Thread starter Qiuzman
  • Start date Start date
Q

Qiuzman

Guest
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:

Code:
"John Doe"
"Doe, Josh"
"John, Doe (DHS)"
"John Doe Phd"
"John"

Outlook will return the following translations as initials

Code:
"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?

<p>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:</p>
<pre><code>"John Doe"
"Doe, Josh"
"John, Doe (DHS)"
"John Doe Phd"
"John"
</code></pre>
<p>Outlook will return the following translations as initials</p>
<pre><code>"John Doe" => JD
"Doe, Josh" => DJ
"John, Doe (DHS)" => JD
"John Doe Phd" => JD
"John" => J
</code></pre>
<p>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?</p>
 

Latest posts

M
Replies
0
Views
1
Mohit Pant
M
Top