How can I convert an array object to string? I tried:
$a = "This", "Is", "a", "cat"
[system.String]::Join(" ", $a)
with no luck. What are different possibilities in PowerShell?
How can I convert an array object to string? I tried:
with no luck. What are different possibilities in PowerShell? |
|||||||||
|
Operator join
Using conversion to
|
|||||
|
I know it's an old thread, but I found that piping the array to the For example:
It depends on your end goal as to which method is the best to use. |
||||
|
You could specify type like this:
Checking the type:
Confirms: IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True String[] System.Array Outputting $a: PS C:\> $a This Is a cat |
|||
|