I'm learning swift. I've been trying this in Playground. I have no idea why the string is not being capitalized here. Or is there any other way to capitalize the string inside the array directly?
Here's my code.
var dogNames = ["Sean", "fido", "Sarah", "Parker", "Walt", "abby", "Yang"]
for index in 0..<dogNames.count {
var dogName = dogNames[index].capitalizedString
dogNames.removeAtIndex(index)
dogNames.append(dogName)
}
When I try to display again the variable dogNames. The strings inside are not being capitalized.