Hello Devs, 

In this tutorial, we will learn Angular Titlecase Pipe Example | Titlecase Pipe in Angular 9/8/7

In this section, we will see full example and how to use angular titlecase pipe for angular capitalize word or text. you can use it in angular 6, angular 7, angular 8 and angular 9 application.

Follow this step by step guide below,


Syntax:

{{ value_expression | titlecase }}


Titlecase Pipe Example:

import { Component } from '@angular/core';

  

@Component({

  selector: 'my-app',

  template: `<div>

    <p>{{ myString | titlecase }}</p>

  

    <p>{{ myString2 | titlecase }}</p>

  

    <p>{{ myString3 | titlecase }}</p>

  

    <p>{{ myString4 | titlecase }}</p>

      

  </div>`,

  styleUrls: [ './app.component.css' ]

})

export class AppComponent  {

  name = 'Angular';

  

  myString = "This IS ANGULAR titleCase pipe eXANPLE";

  

  myString2 = "tutorial,example";

  

  myString3 = "tutorial|example";

  

  myString4 = "tutorial-example";

 

}



Output:

This Is Angular Titlecase Pipe Exanple

  

Tutorial,example

  

Tutorial|example

  

Tutorial-example


May this example help you.