C# Interpolated Strings

String interpolation. This feature inserts values into a string with simple syntax and it is very useful. It is very much like string.Format, but variables may be accessed directly. Its performance is also similar to string.Format calls.

Below is an example of the string interpolation syntax. See that it always starts with a "$" sign.

int string1 = 100;
int string2 = 2;
string animals = $"First string = {string1} and Second string = {string2}";


Popular posts from this blog

Solution for "Can not obtain Oracle client information from registry"

Solution for the fault: "System.Diagnostics.Process.Start is not working on IIS, but working on ASP.NET Development Server"