Capitalize only the first letter of a character

How to Capitalize only the first letter of a character ? upper function capitalize all the letters. I want only to make this change ONLY for the first letter.
Thank you in advance

 Accepted Answer

More Answers (1)

Ive J
Ive J on 25 Jan 2021
Edited: Ive J on 25 Jan 2021
str = "dogs are better than cats";
regexprep(str ,'(\<\w{1})', '${upper($1)}')
"Dogs Are Better Than Cats"

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Asked:

on 25 Jan 2021

Edited:

on 25 Jan 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!