Answer the question
In order to leave comments, you need to log in
[Solved] After inserting a value from an array, the second part of the string disappears without a trace, how to insert it correctly?
Good day. Trimmed (the substring " RIN="+ value
"
disappears without a trace from the startInfo.Arguments string, while in the absence of ED, RIN and value appear.
string ED = WL[NW.SelectedIndex][0];
foreach (string value in WD.Lines) {
startInfo.Arguments = "MainD=IDD ID="+ ED +" RIN="+ value;
}
Answer the question
In order to leave comments, you need to log in
I don't see the argument names, which are usually specified using "-" or "/".
Perhaps it should be:
startInfo.Arguments = "-MainD IDD -ID "+ ED +" -RIN "+ value;
If this is a single argument, then you need to remember that spaces are considered separators between multiple arguments and a single argument that includes spaces must be enclosed in quotes, which we do not forget to escape:
startInfo.Arguments = "-someKey \"MainD=IDD ID="+ ED +" RIN="+ value + "\"";
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question