Actionscript:
-
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:
Actionscript:
-
var alphabet:Array = ["a","b","c".... etc];
3 Comments
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.
Thanks LazyLady. For some reason I didn’t think that would work…. but it does… very cool
Hey thanks,
exactly the thing i was looking for
greets