String.prototype.titleize >= 0.1.0

Purpose

Capitalizes words as you would for a book title

Syntax

String#titleize ( Booleanalways_capitalize= false );

Parameters

always_capitalize

Return values

String

Examples

'harry potter and the goblet of fire'.titleize();
>>> "Harry Potter and the Goblet of Fire"

// Use "true" as first argument to make every word capitalized
'harry potter and the goblet of fire'.titleize();
>>> "Harry Potter And The Goblet Of Fire"

Comments