Generate database field

Hello experts, I have created a form and the database is being filled successfully - everything fine - so far.
The database contains first name and last name, I want to display this information in a shortened form, for example if the user has registered as
Michael Schumacher
a field should be created in the database. M. S.

Which possibilities do you know?
Thanks

So add "initials"value:

const nameParts = name.split(" ");
const initials = nameParts[0][0] + "." + nameParts[1][0] + ".";

Or something like that