Get the first character from a string


#1

This is my HTML file. In ion-text-avatar, I want to pass the first character of the app name.

<ion-list>
          <ion-item *ngFor="let app of apps">   
            <ion-avatar item-start ion-checkbox checked="true">
              <ion-text-avatar shape="round" class="avatar font">{{  }}
              </ion-text-avatar>
            <ion-icon name="checkmark-circle"></ion-icon>  
            </ion-avatar>
              <h6>{{ app }}</h6>
          </ion-item>
        </ion-list>

This is my ts code

apps = [apple,banana,pineapple,grapes];

In the ion-text-avatar, I want to display the first character apple, banana…etc


#2

follow link https://angular.io/api/common/SlicePipe