String interpolation is a very easy and precise way to inject variable values into a string. An interpolated string expression looks at contained expressions. It then replaces those expressions with the
ToString representations of the expressions' results.
Create a new class to test your code. We will use the example of reading the current exchange rate for a specific currency to illustrate how string interpolation can be used to output strings to the user interface.
How to do it…
- Create a new class by right-clicking on your solution, selecting Add, and then selecting New Project from the context menu:
- From the Add ...