how do i declare a string with arguments inside?
suppose
string path = "C:\\Work\\6.70_Extensions\\"
and 6.70_Extensions
is开发者_运维问答 replaced by args parsed
i tried this:
string path = ("C:\\Work\\{0}\\NightlyBuild\\", args[0]) ;
where args[0] is a string. I suppose my syntax is wrong somewhere
You should be using string.Format
for that.
string path = string.Format("C:\\Work\\{0}\\NightlyBuild\\", args[0]) ;
You're looking for String.Format:
string path = String.Format("C:\\Work\\{0}\\NightlyBuild\\", args[0]);
or simple concatenation (after a null check, of cource):
string path = "C:\\Work\\" + args[0] + "\\NightlyBuild\\";
精彩评论