还行吧:
Console.WriteLine("this is the key that has run: {0}", this.ReportKey.ToString());
这种将字符串组合在一起的方式是否仅在为控制台构建参数时可用,或者可以在其他上下文中使用。可以用在下面吗?我已经把我失败的尝试。
public string RunTheReport(){
return "Name: " + this.ReportName " key: " + this.ReportKey.ToString();
//return ("Name: {0} key: {1}", this.ReportName, this.ReportKey.ToString()); <<is there a way to avoid using all the "+" signs?
}