{ "id": "api/common/TitleCasePipe", "title": "TitleCasePipe", "contents": "\n\n
\n
\n
\n \n API > @angular/common\n
\n \n
\n \n
\n

TitleCasePipelink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

Transforms text to title case.\nCapitalizes the first letter of each word and transforms the\nrest of the word to lower case.\nWords are delimited by any whitespace character, such as a space, tab, or line-feed character.

\n\n \n
\n \n \n \n
\n {{ value_expression | titlecase }}\n\n

NgModulelink

\n\n\n\n\n \n

Input valuelink

\n \n \n \n \n \n \n \n \n \n
\n \n value\n string\n \n \n
\n \n \n
\n\n\n \n
\n

See alsolink

\n \n
\n\n\n \n\n\n \n
\n

Usage noteslink

\n

The following example shows the result of transforming various strings into title case.

\n\n@Component({\n selector: 'titlecase-pipe',\n template: `<div>\n <p>{{'some string' | titlecase}}</p> <!-- output is expected to be \"Some String\" -->\n <p>{{'tHIs is mIXeD CaSe' | titlecase}}</p> <!-- output is expected to be \"This Is Mixed Case\" -->\n <p>{{'it\\\\'s non-trivial question' | titlecase}}</p> <!-- output is expected to be \"It's Non-trivial Question\" -->\n <p>{{'one,two,three' | titlecase}}</p> <!-- output is expected to be \"One,two,three\" -->\n <p>{{'true|false' | titlecase}}</p> <!-- output is expected to be \"True|false\" -->\n <p>{{'foo-vs-bar' | titlecase}}</p> <!-- output is expected to be \"Foo-vs-bar\" -->\n </div>`\n})\nexport class TitleCasePipeComponent {\n}\n\n\n\n
\n\n\n\n
\n
\n\n\n" }