November 2017
Intermediate to advanced
800 pages
30h 51m
English
The two most common tasks that a console application performs are writing and reading data. We have already been using the WriteLine method to output. If we didn't want a carriage return at the end of the lines, we could have used the Write method.
C# 6 and later has a handy feature named string interpolation. This allows us to easily output one or more variables in a nicely formatted manner. A string prefixed with $ can use curly braces around the name of a variable to output the current value of that variable at that position in the string.
In the Variables project, enter the following statements at the bottom of the Main method:
Console.WriteLine($"The UK population is {population}."); Console.Write($"The ...Read now
Unlock full access