Title Case

Capitalize the first letter of each word in a string.

Code

General
str.split.map(&:capitalize).join(' ')

Parameters

The string to convert to title case

Server

More Ruby Snippets