Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
Capitalize first letter of a string using Angular or typescript

How can I capitalize the first letter of a string using Angular or typescript?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

function titleCaseWord(word: string) {
  if (!word) return word;
  return word[0].toUpperCase() + word.substr(1).toLowerCase();
}

You can also use in template TitleCasePipe

Some component template:

{{value |titlecase}}
over 4 years ago · Santiago Trujillo Report

0

 let str:string = 'hello';
 str = str[0].toUpperCase() + str.slice(1);
over 4 years ago · Santiago Trujillo Report

0

var str = 'santosh';
str = str ? str.charAt(0).toUpperCase() + str.substr(1).toLowerCase() : '';
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!