String Flashcards
1
Q
Make an array from the string
A
- chars
If you just want to convert string to char array in ruby,
"string".chars # ["s", "t", "r", "i", "n", "g"]
- split(‘’)
2.1.1 :086 > s.split(‘’)
=> [“a”, “s”, “d”, “f”, “g”]
but!
2.1.1 :085 > s.split
=> [“asdfg”]