UCWords

In: Computers|Cool Links|Ideas|Insanity|OCD|Programming

13 Apr 2008

Every now and then I find that I need to do something that seems remarkably obscure, and am surprised to learn that PHP has a function to do it. I found myself cleaning up a really sub-par Wikipedia article, where someone had entered a massive list of things in ALL CAPS.

It’s easy enough to upper-case everything, or to lower-case everything. But what I really wanted to was to capitalize the first letter of each word, because they’re all proper nouns. It turns out that PHP has a ucwords function to do precisely this.

And thus this page, which I suspect will never be useful to anyone, was born. Enter text, and it’ll covert it to lowercase, but upper-case the first letter of each word. And in this case, the time required to write the script was less than the time it’d have taken me to change it all by hand.

Related posts:

  1. Tip o’ the Day
  2. Geolocation
  3. Starting Writing
  4. Speeding up MySQL with tmpfs?
  5. Passwords

2 Responses to UCWords

Avatar

Mr. T

April 13th, 2008 at 10:59 pm

That reminds me of TPU. It was basically a language for editing. The formal editor that was written using it was called EVE. It was amazing. I highly customized it for my own use and one of the things I added was a simple functionto do what ucwords does. Saved me lots and lots of time. I miss that editor.

Avatar

Matt

April 14th, 2008 at 2:30 pm

I hardly mean to compare vim to Word, but this is the type of thing I miss in Word. The ability to execute “commands” on the text.

Comment Form

On Other Sites

  • Matt: Hey Victor, A couple good resources for you... http://www.scanboston.com/boston.htm is really det [...]
  • victor: Hi i just got a uniden bearcay scanner and have no local or regional frequency directory.just 1 460 [...]
  • Matt: I do use them periodically. I bought a few i760's, for perhaps $10 apiece in a lot, on eBay a while [...]
  • Marin: Did you eventually end up going with an iDEN phones using Direct Talk? I had some i560's a few year [...]
  • Dan: fyi, EOD = explosive ordnance disposal [...]