June 12th, 2014

PowerTip: Find Other Ways to Use Split Method

Doctor Scripto
Scripter

Summary: Find other ways to use the Windows PowerShell Split method.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find if there are other ways to use the Split method from a String object?

Hey, Scripting Guy! Answer Use the PSMethod object that returns from the method when not calling it with parenthesis,
          and then call the OverLoadDefinitions property, for example:

PS C:> “string”.split.OverloadDefinitions

string[] Split(Params char[] separator)

string[] Split(char[] separator, int count)

string[] Split(char[] separator, System.StringSplitOptions options)

string[] Split(char[] separator, int count, System.StringSplitOptions options)

string[] Split(string[] separator, System.StringSplitOptions options)

string[] Split(string[] separator, int count, System.StringSplitOptions options)

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.

Feedback