capitalize

capitalize ( string txt , int _policy ) : string

Set capital letters to words

Example


console(capitalize("hello world", 4)) // -> Hello World

Parameters

txt

_policy (optional)

• 1 (default) : "foO bAR" become "Foo bar"
• 2 : "foO bAR" become "FoO bAR"
• 3 : "foO bAR" become "FoO BAR"
• 4 : "foO bAR" become "Foo Bar"