Eggins.com
Powershell, .Net, Visual Studio, Team Foundation Server, Windows Communication Foundation

Powershell - Load 256 chars into char array

All 4 of these Powershell lines do exactly the same thing. Load the first 256 chars into a char array.


for ([int]$i = 0; $i -le 255; $i++) {$a += [char]$i};

0..255|%{$a+=[char]$_}

$a=0..255|%{[char]$_}

[char[]]$a=0..255

 


Posted Feb 22 2007, 11:06 AM by David
Filed under:

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Copyright eggins.com, 1998 - 2008
Powered by Community Server (Non-Commercial Edition), by Telligent Systems