Created
January 5, 2018 05:12
-
-
Save ScriptingPro/2d9f75a8d144bb08878f226620c49ed4 to your computer and use it in GitHub Desktop.
Playing with Collections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SplitHereString = @" | |
a | |
b | |
c | |
"@ -split [System.Environment]::NewLine | |
$SplitHereString.GetType() # notice it's String[] / System.Array | |
$ConstructedArray = @('a','b','c') | |
$ConstructedArray.GetType() # notice it's Object[] / System.Array | |
$TypecastedConstructedArray = [string[]]@('a','b','c') | |
$TypecastedConstructedArray.GetType() # notice it's String[] / System.Array | |
$SplitNumberHereString = @" | |
1 | |
2 | |
3 | |
"@ -split [System.Environment]::NewLine | |
$SplitNumberHereString.GetType() # notice it's String[] / System.Array | |
[int[]]$TypecastedSplitNumberHereString = @" | |
1 | |
2 | |
3 | |
"@ -split [System.Environment]::NewLine | |
$TypecastedSplitNumberHereString.GetType() # notice it's Int32[] / System.Array | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment