在使用string.format时如果前面语句中要添加括号{只需要{{两个括号即可表示了。
例如:
string statement = "this is {0} and {1} {{";
Console.Write(string.Format(statement,"john","lee"));
则可以输出this is john and lee{
在使用string.format时如果前面语句中要添加括号{只需要{{两个括号即可表示了。
例如:
string statement = "this is {0} and {1} {{";
Console.Write(string.Format(statement,"john","lee"));
则可以输出this is john and lee{