I've also made something for anyone trying to get a first name or first string from unclean data.
This returns most first names in proper format (examples: “jOhN SMITH” to “John” or “McJohnson SMITH” to “Mcjohnson” or “ jane ” to “Jane”)
With Compose Steps to avoid invalid space ‘ ’ entry in expressions
Compose_2:
int(indexOf(trim([Full Name Dynamic Content]), ' ')), 1)))
Compose_3:
contains(trim([Full Name Dynamic Content]), ''' ''')
Copy here ↓ & enter dynamic content with names wherever it says "[Full Name Dynamic Content]".
if(outputs('Compose_3'), trim(concat(substring(toupper(trim([Full Name Dynamic Content])), 0, 1), substring(toLower(trim([Full Name Dynamic Content])), 1, sub(outputs('Compose_2'), 1)))), trim(concat(substring(toupper(trim([Full Name Dynamic Content])), 0, 1), substring(toLower(trim([Full Name Dynamic Content])), 1))))
Example in an automatic response email that is sent out if the email field in a form has a value. There is also a back-up automatic email if something fails with the first name expression.

Use of the clean first name formula.
