Unit 'StrUtils' Package
[Overview][Resource strings][Constants][Types][Procedures and functions][Index] [#rtl]

SplitCommandLine

Split commandline in a series of separate arguments.

Declaration

Source position: strutils.pp line 313

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

See also

TRawByteStringArray

  

Array of RawByteString.

TUnicodeStringArray

  


Documentation generated on: Dec 26 2024