Click or drag to resize

ParseOptionsNameValueSeparator Property

Gets or sets the character used to separate the name and the value of an argument.

Namespace:  Ookii.CommandLine
Assembly:  Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 2.4.0
Syntax
public char NameValueSeparator { get; set; }

Property Value

Type: Char
The character used to separate the name and the value of an argument. The default value is the DefaultNameValueSeparator constant, a colon (:).
Remarks

This character is used to separate the name and the value if both are provided as a single argument to the application, e.g. -sample:value if the default value is used.

Note Note
The character chosen here cannot be used in the name of any parameter. Therefore, it's usually best to choose a non-alphanumeric value such as the colon or equals sign. The character can appear in argument values (e.g. -sample:foo:bar is fine, in which case the value is "foo:bar").
Note Note
Do not pick a whitespace character as the separator. Doing this only works if the whitespace character is part of the argument, which usually means it needs to be quoted or escaped when invoking your application. Instead, use the AllowWhiteSpaceValueSeparator property to control whether whitespace is allowed as a separator.
See Also