C# string.Format 实用方式

来源:互联网 发布:html,css,js入门书籍 编辑:程序博客网 时间:2024/05/20 06:41

String.Format是将指定的 String类型的数据中的每个格式项替换为相应对象的值的文本等效项。
class Program
{
static void Main(string[] args)
{
int n = 5;
string s;
s = string.Format(“{0}”, n);
Console.WriteLine(s);
Console.ReadKey();
}
}
这里写图片描述

1 0
原创粉丝点击