Click or drag to resize

CommandLineSubstituteArgument Method

Given a string, containing batch style placeholders for environment variables and numbered parameters, the placeholders are replaced by the referred parameter values.

Namespace:  Mastersign.Bench
Assembly:  BenchLib (in BenchLib.dll) Version: 0.22.0.0 (0.22.0.0)
Syntax
public static string SubstituteArgument(
	string value,
	string[] parameters
)

Parameters

value
Type: SystemString
A string possibly with placeholders for environment varibales and numbered parameters. Environment variables are written as %NAME%, and numbered parameters are written as %x, with x beeing a digit from 0 to 9.
parameters
Type: SystemString
An array with ordered parameter strings.

Return Value

Type: String
An array with the substituted strings.
Examples
Given the environment variable MY_DIR with a value of C:\my-dir, and an array with ["a", "b"] for parameters, a string with "-out %MY_DIR%\%1-%2.txt" for value is substituted into the following result: "-out C:\my-dir\a-b.txt".
See Also