how to capitalize the first word of a sentence in ionic how to capitalize the first word of a sentence in ionic

The solution for “how to capitalize the first word of a sentence in ionic how to capitalize the first word of a sentence in ionic” can be found here. The following code will assist you in solving the problem.

import { Component, OnInit } from ‘@angular/core’;

@Component({
selector: ‘app-textarea-test’,
templateUrl: ‘./textarea-test.page.html’,
styleUrls: [‘./textarea-test.page.scss’],
})
export class TextareaTestPage implements OnInit {

someAutoFormattedInput: string;

constructor() { }

ngOnInit() {
}

onAutoFormatChanged() {
this.someAutoFormattedInput = this.setFirstLetterToUppercase(this.someAutoFormattedInput);
}

private setFirstLetterToUppercase(string:string):string {
// https://dzone.com/articles/how-to-capitalize-the-first-letter-of-a-string-in
return string.charAt(0).toUpperCase() + string.slice(1);
}

}
Text Area Test



Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in