|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: Capitalize First Letter of Each Wordby halley (Prior) |
| on Jun 30, 2005 at 11:43 UTC ( [id://471370]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
By the way, the problem as stated is fairly simple (as others have demonstrated). However, there are a LOT of patterns which probably shouldn't be capitalized at all, or should have multiple capital letters in a word.
Many of these cases are handled by what I call "title case." The rules vary from style guide to style guide, but as I learned them,
From there, you can try to "restore" words that fit certain patterns, but you'll probably fail. For example, "MacIntyre" but "Macintosh™." Names do not follow common grammatical or spelling rules; they are individual and a special case. Where possible, take the name's owner's spelling and don't corrupt it into all-caps in the first place. --
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||