Generate array of all letters and digits

后端 未结 7 944
温柔的废话
温柔的废话 2021-01-30 07:49

Using ruby, is it possible to make an array of each letter in the alphabet and 0-9 easily?

7条回答
  •  死守一世寂寞
    2021-01-30 08:38

    letters = *('a'..'z')
    

    => ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]

提交回复
热议问题