Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

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

$
0
0

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


Viewing all articles
Browse latest Browse all 3333

Trending Articles