Would it be possible to loop through each character in the string, and then place each character into an array?
I'm new to swift, and I'm trying to figure this out. Could someone write a code for this?
Would it be possible to loop through each character in the string, and then place each character into an array?
I'm new to swift, and I'm trying to figure this out. Could someone write a code for this?
It's really simple:
let str = "My String"
let letters = str.characters.map({String($0)})
print(letters)