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


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() 

Comments (1)

  1. Thanks for posting these tips.

Skip to main content