相关疑难解决方法(0)

在String.Format中转义大括号'{'

使用String.Format方法时如何显示文字大括号字符?

例:

sb.AppendLine(String.Format("public {0} {1} { get; private set; }", 
prop.Type, prop.Name));
Run Code Online (Sandbox Code Playgroud)

我希望输出看起来像这样:

public Int32 MyProperty { get; private set; }
Run Code Online (Sandbox Code Playgroud)

.net c# string

890
推荐指数
1
解决办法
20万
查看次数

标签 统计

.net ×1

c# ×1

string ×1