sorry, ToString method should end with:
return sb.ToString();
}
Main Topics
Browse All TopicsI need some functions that will take a person's full name as a string, and attempt to extract the various piecces of it, i.e.:
GetFirstName(), GetNamePrefix(), GetMiddleName(), GetNameSuffix()
What I would pass in would be something like:
John Doe
Dr. Alvin Chipmunk Ph.D.
Miss Mary Kate O'Reily
Mr. Alberto Juan De Laurentis
I was hoping that there might be some functions out there already to handle this so I wouldn't have to re-invent the wheel? I'll take code in either C# or VB.NET, or whatever really, as long as it can be converted to .NET of some sort.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
jaime,
I agree with you approach completely, but I just dont have that luxury :)
I have a client (a bank no less) that has some very old data in a database where the names have been entered as one long string, and well - you guessed it, they want to get the data back out.
I am working on my own function, and made up a list of prefixes I know of to check against. Postfixes are tougher as they are practically limitless, and some have periods (Ph.D., Sr. D.D.S) and some don't (such as roman numerals). At some point, I just have to make an educated guess.
The first/last name thing is an issue with non-American names, and middle names can get out of hand sometimes as well, since there can be multiple ones.
Business Accounts
Answer for Membership
by: jaime_olivaresPosted on 2007-11-16 at 10:18:07ID: 20300189
Is is not as easy. Consider this case:
Juan Marcelo Menotti
How you will know if Marcelo is the Middle Name or it is the second first name?
A dictionary will be useless.
You can try to attack the problem by a different side. Store the name components separately:
Select allOpen in new window