What are Interpolated Strings

An interpolated string expression looks like a template string that contains expressions. An interpolated string expression creates a string by replacing the contained expressions with the ToString representations of the expressions’ results. An interpolated string is easier to understand with respect to arguments than Composite Formatting.
string language=”C#”;
string ide=”Visual Studio”;
Console.WriteLine($”Language = {language}, IDE= {ide}”);
It will print the following:
Language = C#, IDE = Visual Studio

Leave a Reply

Your email address will not be published. Required fields are marked *