This blog post is part of C# 6.0 Features Series.As we all know, C# 6.0 provides lots of small enhancements to the language and string interpolation is one of them. In this blog post we are going to learn how this small new feature can help us for string concatenation.
So let’s take small example, Where I have created a new example of string concatenation. Following is a code for that.
using System; namespace StringInterpolation { class Program { static void Main(string[] args) { string name = "Jalpesh Vadgama"; //Old way of string concentaionation Console.WriteLine("My name is" + name); Console.WriteLine("My name is {0}", name); //New way of doing this Console.WriteLine("My name is {name}"); } } }