SplitCommandLine¶
Split commandline in a series of separate arguments.
Declaration¶
Source position: strutils.pp line 320
function SplitCommandLine(S: RawByteString) : TRawByteStringArray;
function SplitCommandLine(S: UnicodeString) : TUnicodeStringArray;
Description¶
SplitCommandline parses S into words separated by whitespace, and returns a list of separate words (command-line arguments): When parsing it takes into account quoting with single (') or double quote (") characters: a word that contains whitespace can be enclosed in a quote character and will be considered a single word.
You can call this function with a UnicodeString or a RawByteString, the resulting array will have the same type of elements.
for example:
first "second argument" 'third argument'
Will result in an array of 3 elements
- first
- second argument
- third argument
See also¶
| Name | Description |
|---|---|
| TRawByteStringArray | Array of RawByteString. |
| TUnicodeStringArray |