First letter of juce::String to upper case?

Is there an obvious way to force the first letter of a juce::String to always be upper cased?

foo -> Foo

Or/and what’s your best approach?

s.substring (0, 1).toUpperCase() + s.substring (1) ?

Looks like a similar thing was proposed a while back: Titlecase function

Maybe you can make use of their implementation?

1 Like

It seems you don’t get modifying access to the string, so your code might be all we get.
I assume it is because of the underlying different multibyte formats.

Making it a free function is probably the way to go

1 Like