Generate array of all letters and digits

后端 未结 7 921
温柔的废话
温柔的废话 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
    myarr = [*?a..?z]       #generates an array of strings for each letter a to z
    myarr = [*?a..?z] + [*?0..?9] # array of strings a-z and 0-9
    
    0 讨论(0)
提交回复
热议问题