My Technical Notes

Thursday, 21 February 2013

Using Powershell to iterate from A through to Z

The following script will print out A through to Z:


[char] $c = 'A'
while ([int]$c -le [int][char]'Z') {
 echo $c
 $c = [char](([int]$c) + 1);
}

No comments: