C# Command-Line Parsing of Quoted Paths and Avoiding Escape Characters

后端 未结 3 2090
[愿得一人]
[愿得一人] 2020-12-10 10:16

How is it possible to parse command-line arguments that are to be interpreted as paths? args[] contains strings that are automatically joined if they are quoted, e.g.:

3条回答
  •  温柔的废话
    2020-12-10 11:13

    I like your idea:

    _path = args[i].Replace("\"", @"\");
    

    It is clean, and will have no effect unless the problem exists.

提交回复
热议问题