Is there an easy way to just capitalize the first character in a String?
I’m working on the iOS Foundations Module 2 Challenge 12, and I want to display only the first topping’s letter upper-cased. Rather, using the .capitalized string method, it capitalizes every word.
StackOverflow has people using extensions of the String type, but I don’t understand these. capitalization - How to capitalize the first character of sentence using Swift - Stack Overflow
Otherwise, ideally, I’d like to slice the string like this as Python would do it:
capitalizedString = toppings[0].capitalized + toppings[1:]