# Does a Command exist for Proper Names?

**URL:** <https://www.ruby-forum.com/t/does-a-command-exist-for-proper-names/72530>\
**Category:** Rails\
**Created:** [October 17, 2006, 9:13pm UTC](https://www.ruby-forum.com/t/does-a-command-exist-for-proper-names/72530 "2006-10-17T21:13:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e0b2c6/32.png) [@mic](https://www.ruby-forum.com/u/mic)\
**Post date:** [October 17, 2006, 9:13pm UTC](https://www.ruby-forum.com/t/does-a-command-exist-for-proper-names/72530/1 "2006-10-17T21:13:12Z")

</div>

I am taking in a dataset of names but want to print them out nicely.  
Some of them are all caps, others have none. While I found the string  
class for capitalize, it only catches the first letter of the first  
name.

Since you get things like Alex O’Brien or Tim R La Punta I could write  
up something that acknowledges these cases and caps anything after a  
space or quote, but was wondering if there was anything built in to use.

---

<div class="post-metadata">

**Author:** ![mic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e0b2c6/32.png) [@mic](https://www.ruby-forum.com/u/mic)\
**Post date:** [October 17, 2006, 9:28pm UTC](https://www.ruby-forum.com/t/does-a-command-exist-for-proper-names/72530/2 "2006-10-17T21:28:26Z")

</div>

> I am taking in a dataset of names but want to print them out nicely.  
> Some of them are all caps, others have none. While I found the string  
> class for capitalize, it only catches the first letter of the first  
> name.
> 
> Since you get things like Alex O’Brien or Tim R La Punta I could write  
> up something that acknowledges these cases and caps anything after a  
> space or quote, but was wondering if there was anything built in to use.

> > “Tim R la PUnta”.downcase.titlecase  
> > =\> “Tim R La Punta”

---

<div class="post-metadata">

**Author:** ![mic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e0b2c6/32.png) [@mic](https://www.ruby-forum.com/u/mic)\
**Post date:** [October 17, 2006, 10:12pm UTC](https://www.ruby-forum.com/t/does-a-command-exist-for-proper-names/72530/3 "2006-10-17T22:12:58Z")

</div>

Perfect! Thanks for the help. Titlecase eh? Who woulda thought.
