array = ["BOY","GIRL","MAN"]
// func to convert it to array = ["Boy" ,"Girl","Man"]
Is there a way to do this without rewriting the contents of the array with lowercase letters. I used uppercase letters to form a long string array.
< pre>let array = [“BOY”,”GIRL”,”MAN”]
let capitalizedArray = array.map {$0.capitalizedString}
< p>I have an array of strings, but all jingle is written in uppercase letters. Is there a way for me to set all strings in the array to lowercase (and use uppercase and lowercase)
< p>
array = ["BOY","GIRL","MAN"]
// func to convert it to array = ["Boy","Girl","Man"]
Is there a way to do this without rewriting the contents of the array with lowercase letters. I used uppercase letters to form a long array of strings.
< /p>
You can use the map function like this:
let array = ["BOY","GIRL","MAN"]
let capitalizedArray = array.map {$0.capitalizedString}