首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

Console.WriteLine中{零}处理

2013-12-10 
Console.WriteLine中{0}处理string str helloConsole.WriteLine{“{0}”,i}//输出hello假如我想输出h

Console.WriteLine中{0}处理
string str = "hello";
Console.WriteLine{“{0}”,i};//输出hello

假如我想输出"hello {0}"
怎么办
[解决办法]
string str = "hello";
Console.WriteLine("{0}{1}", str, "{0}");//输出hello{0}

热点排行