Prev: Cognizance presents INSOMNIA: The Midnight Programming Contest
Next: Hash enumeration returning nulls?
From: Oziris Moreira on 26 Mar 2010 12:18 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/.
From: Giampiero Zanchi on 26 Mar 2010 12:19 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/.
From: Oziris Moreira on 26 Mar 2010 12:30
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/. |