using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace test4 { class Program { ... ...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace test4 { class Program { static void Main(string[] args) { //$是對string.Format的簡化。 //變化點:string.Format() {0} string a1 = string.Format("Time :{0}", DateTime.Now); Console.WriteLine(a1); string a2 = $"Time :{DateTime.Now}"; Console.WriteLine(a2); Console.ReadKey(); } } }