【发布时间】:2013-04-12 16:32:32
【问题描述】:
鉴于此:
string msg = string.Format("Duckbill {0} Platypus has not been loaded. Fetch Duckbill {1}'s Platypus then continue.", userDuckbill, userDuckbill);
...这样做是否就足够了:
string msg = string.Format("Duckbill {0} Platypus has not been loaded. Fetch Duckbill {1}'s Platypus then continue.", userDuckbill);
?
【问题讨论】:
-
稍作测试就可以为您节省一些在 stackoverflow 上的时间。在这种情况下,测试确实比询问更容易。
-
不是我的情况;测试最简单的东西需要几分钟。
-
我推荐linqpad.net
-
我有 Linqpad,但我要么忘记了,要么不知道它适用于非 LINQ 的东西。
-
在 LINQPad 中有这个:MessageBox.Show("This is {0}", "this"); ...并选择了“C# 语句 [s]”,当我捣碎绿色箭头 [!TM] 时,我得到“当前上下文中不存在名称 'MessageBox'”
标签: c# string.format