I have a process in which the imput are e-mails. With sender the name of the one sending the mail appears to me in the order first name and last name. I need to paste that information into an application in the reverse order, i.e. first the last name, comma and first name. How can I do it?
I already have an approximate solution that is separating with Split by spaces, but it is a problem because sometimes the first name is composed.
here Strrr is my string variable replace it with your’s
using this code it’ll check the what kind of name we have whether is has space in between or composed and
if its composed then my Regex pattern will get the two values based on the Captial letters of each word and then it’ll rearrange the order and also add a comma to it.
If it has space in between it’ll just get the two words using regex and reverse the order and add a comma.In the end (0) is to get the first value as we had split it using each character.
It doesn’t work well for me at all. If the name is for example Maria Luisa Ontiveros Gonzalez I need Ontiveros Gonzalez, Maria Luisa and for example if the name is Marta Lopez Castilla I need Lopez Castilla, Marta. With the formula that you propose gives me Gonzalez, Ontiveros, Luisa, Maria and so the application does not allow me. Thanks a lot.