-2

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?

1

1 Answer 1

0

It's really simple:

let str = "My String"
let letters = str.characters.map({String($0)})
print(letters)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.