I need to get the first and last name of a string. For example, if the full name is:
Renan Rodrigues Moraes
I only need to get Renan Rodrigues
. I know what I should do but I do not know how. In case the name is Renan de Assis
it would be interesting to return Renan de Assis
.
I know what I should do, but I do not know how.
The main idea is to count two spaces, from the second show nothing. Does anyone have a suggestion to extract this from the string?