Quick Alphabet Array

var alphabet:Array = ("abcdefghijklmnopqrstuvwxyz").split("");
trace("this is the letter b...", alphabet[1]);
trace(alphabet);
/* outputs:
this is the letter b... b
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
*/

This is an easy way to create an array of the alphabet. It’s easier to type than:

var alphabet:Array = ["a","b","c".... etc];

3 comments

  1. Thanks for a great initiative. Very handy to see your code snippets and easily try them out.

    var alphabet:Array = (“abcdefghijklmnopqrstuvwxyz”).split(“”);

    Could be written like this:
    var alphabet:Array = “abcdefghijklmnopqrstuvwxyz”.split(“”);
    as long as your not casting.

Leave a Reply

Your email address will not be published. Required fields are marked *