# String array

**URL:** <https://www.ruby-forum.com/t/string-array/185818>\
**Category:** Ruby\
**Created:** [March 26, 2010, 5:18pm UTC](https://www.ruby-forum.com/t/string-array/185818 "2010-03-26T17:18:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oziris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/df788c/32.png) [@oziris](https://www.ruby-forum.com/u/oziris)\
**Post date:** [March 26, 2010, 5:18pm UTC](https://www.ruby-forum.com/t/string-array/185818/1 "2010-03-26T17:18:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![oziris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/df788c/32.png) [@oziris](https://www.ruby-forum.com/u/oziris)\
**Post date:** [March 26, 2010, 5:19pm UTC](https://www.ruby-forum.com/t/string-array/185818/2 "2010-03-26T17:19:36Z")

</div>

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(’’)

---

<div class="post-metadata">

**Author:** ![oziris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/df788c/32.png) [@oziris](https://www.ruby-forum.com/u/oziris)\
**Post date:** [March 26, 2010, 5:30pm UTC](https://www.ruby-forum.com/t/string-array/185818/3 "2010-03-26T17:30:54Z")

</div>

Giampiero Z. 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 !
