Possible Duplicate:
Does anyone have a good Proper Case algorithm
I am currently in the unfortunate position of having a requirement thrust on me to display names of users that are loaded as part of a batch process from various sources (Excel, Access, etc…) with the correct character casing.
For example, if a name was loaded as “JOHN DOE” it should display as “John Doe”.
Obviously this gets very complicated very quickly with names like McDonald, O’Reilly, LeBron, etc…
When researching this, the only thing I could find was advice saying to display the names in all caps, while this solution is preferred over showing names like Mcdonald, O’reilly and Lebron I would still like to be sure that I’ve done my due diligence before returning to them with “this is all you can have”.
Are there any libraries out there (open source or paid) that could help accommodate this? I realize that it most likely cannot be perfect, but if it could cover 95~99% of the cases, then that should do fine.
Thanks in advance.
You could check out Perl’s NameCase module, which does exactly this.