Login
Theme: Light Dark

How can I ask someone a question and break each number and letter to an array?

Tagged:

Home - Quora Link

If you’re using Ruby, then you can just do .chars on the string, it turns the string into an array.

  1. "Hello".chars # outputs: ["H", "e", "l", "l", "o"] 

Other languages have similar functions in their standard library. If you posted which language you were using I can give you a method for that language.