July 17th, 2014

PowerTip: Use PowerShell Split Operator to Break Strings

Doctor Scripto
Scripter

Summary: Learn how to use the Windows PowerShell Split operator to break up strings.

Hey, Scripting Guy! Question How can I use Windows PowerShell to break a string at a specific character?

Hey, Scripting Guy! Answer Use the Split operator and specify the character to split on, for example:

PS C:\> "this,is,a,string" -split ","

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.