Get Title, Forename(s) and Surname
I am thinking you could split on the space delimiter and then post from right
to left.
surname would always be the extreme right. The tricky part is breaking the
title out. I suppose that would have to be by exception, like If item = mr.
Or if item = ms. Then post to extreme left field. Figuring this out could
keep you busy for a while.
" wrote:
Hello Everyone,
I have got a field that has the full name of a person.
I am basically looking for a code (or ideas) to get the Title,
Forname(s) and Surname from the supplied full name.
Some examples:
1. Input: Mr Lucas
Output:
Title: "Mr"
Forename: ""
Surname: "Lucas"
2. Input: John Lucas
Output:
Title: ""
Forename: "John"
Surname: "Lucas"
3. Input: John Lewis Lucas
Output:
Title: ""
Forename: "John Lewis"
Surname: "Lucas"
4. Input: Mr John Lucas
Output:
Title: "Mr"
Forename: "John"
Surname: "Lucas"
5. Input: Mr John Lewis Lucas
Output:
Title: "Mr"
Forename: "John Lewis"
Surname: "Lucas"
Can someone suggest some ideas of it would be great if you have a code
that I can use.
Many Thanks,
Nevaank
|