可以识别字符串中占位符的函数Console.WriteLine()和string.Format()
public static void Main() { int a = 5; string b = "6"; string c = "{0}和{1}"; Console.WriteLine(c,a,b); string d= string.Format(c,a,b); Console.WriteLine(d); Console.ReadKey(); }