Skip to content

Instantly share code, notes, and snippets.

@elbruno
Created April 20, 2015 13:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save elbruno/9082aea4921d0d2284fd to your computer and use it in GitHub Desktop.
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