.split(" ") but splits all chars

Okay, when I split a string at every space, it does what’s expected. But
when I call the array at x (array[x]) it only shows the first letter
rather than the part of the string I split. Let me just show you what
the problem is…

a = “one two three”
=> “one two three”
a.split(" ")
=>[“one”, “two”, “three”]
num = 0
=> 0
while num < a.length
puts a[num]
num = num + 1
end
o
n
e

t
w
o

t
h
r
e
e
=> nil

Can someone explain to me why this is happening? Why isn’t it showing
this instead?

“one
two
three
=> nil”

Let me add that I was unable to find anything on google to help me
because I didn’t know how to word my question.

a = “one two three”
=> “one two three”
a.split(" ")
=>[“one”, “two”, “three”]

a.split create an array, which must be affected to something. a
remain unchanged :

b=a.split(" ")
p b
[“one”, “two”, “three”]
p a
“one two three”