PowerTip: Put Array of Letters Back into a Word with PowerShell

The Scripting Guys

Dr

Summary: Use Windows PowerShell to put an array of letters back together to form a word.

Hey, Scripting Guy! Question I split a word by converting it to a chararray, and now I want to put it back together.
           How can I use Windows PowerShell to do this?

Hey, Scripting Guy! Answer Use the –Join operator to put the characters back together. To convert it back to a string,
           add the ToString method, for example:

$a = "dog".ToCharArray() 

($a -join '').tostring() 

The Scripting Guys
Dr Scripto

Follow Dr   

No Comments.