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.
"Bit o' Mint"
"Mano y Mano"
"Chris diBona"
"Scrooge McDuck"
"Cruella de Ville"
"Jake O'Shaunessy"
"Tales from the Crypt"
"Sanford and Son Salvage Company"
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,
- The first word is capitalized, always.
- The last word is capitalized, always.
- Each remaining word is capitalized, except
- prepositions (of, by, from, ...),
- coordinating conjunctions (and, or),
- articles (the, a, an),
- common foreign prepositions, conjunctions, articles.
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.
-- [ e d @ h a l l e y . c c ]
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|