String array

I would like to know how I can put a word into an array character by
character, for example the user type the word "hello" and the array
would be ["h","e","l","l","o"], I only know how to this with gets but I
don't want to press enter after every character.

thanks in advance

···

--
Posted via http://www.ruby-forum.com/.

Oziris Moreira wrote:

I would like to know how I can put a word into an array character by
character, for example the user type the word "hello" and the array
would be ["h","e","l","l","o"], I only know how to this with gets but I
don't want to press enter after every character.

thanks in advance

s = 'hello'
s_array = s.split('')

···

--
Posted via http://www.ruby-forum.com/\.

Giampiero Zanchi wrote:

Oziris Moreira wrote:

I would like to know how I can put a word into an array character by
character, for example the user type the word "hello" and the array
would be ["h","e","l","l","o"], I only know how to this with gets but I
don't want to press enter after every character.

thanks in advance

s = 'hello'
s_array = s.split('')

thank you very much !

···

--
Posted via http://www.ruby-forum.com/\.