This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string name = "Valentino"; | |
int age = 7; | |
var data1 = string.Format("name:{0}, age:{1}", name, age); | |
Console.WriteLine("classic string format - {0}", data1); | |
var data2 = $"name:{name}, age:{age}"; | |
Console.WriteLine("string interpolation - {0}", data2); | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment