Generate and recurse through the alphabet


/ Published in: Ruby
Save to your folder(s)

Just an easy way to loop through and generate the alphabet in Ruby


Copy this code and paste it in your HTML
  1. puts ("a".."z").to_a
  2.  
  3. #=> [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]
  4.  
  5. ("a".."z").each{|letter| puts letter}

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.