How to convert firstName.lastName@domain.com email to a proper name in formula field

How to convert firstName.lastName@domain.com email to a proper name in formula field

I'm having difficulty converting an email field into a proper name.

The email address all are firstName.secondName@domain.com

Here is what I've created in a formula field based on the "Primary_Tax_Partner" field but it only seems to work sometimes:
 (input.Primary_Tax_Partner.getPrefix(".") + " " + input.Primary_Tax_Partner.getSuffix(".")).remove("@domain.com").proper()