powershell: an array of alphabets
i wish i could remember where i found this particular gem. as you know, it's crazy easy to create an array of values if they're integers such as:
[1] {C:\temp} > $a = 1..10[2] {C:\temp} > $a12345678910
but what about when you want an array of alphabetical characters like a through z? it's not as simple as defining the range as a..z. instead, you have to call the char type as shown below:
[7] {C:\temp} > $alphabet = [char[]]([char]'a'..[char]'z')[8] {C:\temp} > $alphabetabcdefghijklmnopqrstuvwxyz
I can't read sh*t but that in fact was helpful. Thanks.
ReplyDeletelol i didn't realize anyone still read this
Delete