ASCII Table

by Mar 15, 2012

Here’s a simple way of creating an ASCII table through type casting:

32..255 | ForEach-Object {
  'Code {0} equals character {1}' -f $_, [Char]$_
}

Likewise, to get a list of letters, try this:

PS> [Char[]](65..90)
A
B
(...)
X
Y
Z

PS> -join [Char[]](65..90)
ABCDEFGHIJKLMNOPQRSTUVWXYZ

PS> [Char[]](65..90) -join ','
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

Twitter This Tip! ReTweet this Tip!