Set*_*man 6 .net c# string variables
C#newbie here.我试图设置一个C#变量如下.
string profileArg = @"/profile ""eScore"" ";
Run Code Online (Sandbox Code Playgroud)
最终结果是我希望变量包含值
/profile "eScore"
Run Code Online (Sandbox Code Playgroud)
"eScore"之后字符串中应该有一个空格
我该怎么做?
赛斯
jga*_*fin 13
您在字符串中的eScore之后有空格.
// a space after "eScore"
string profileArg = @"/profile ""eScore"" ";
// no space after "eScore"
string profileArg = @"/profile ""eScore""";
// space in "eScore "
string profileArg = @"/profile ""eScore """;
// No space using escaping
string profileArg = "/profile \"eScore\"";
Run Code Online (Sandbox Code Playgroud)