Capitalisation - How to Change Just the First Letter of a String/Sentence/Paragraph to Capitals

Additionally, if it’s just for the presentation and you don’t care how it’s stored you can use CSS. This will save you from having to do the transform all over your app if you need it more than once.

i.e.

p.capitalize {
  text-transform: capitalize;
}

Edit: Sorry I was too lazy to read all the thread. You just want the first letter of the string. You can use the pseudo-element :first-letter

p:first-letter {
  text-transform: uppercase;
}
1 Like