Beginning C# 7 Hands-On – The Core Language by Tom Owsiak

Beginning C# 7 Hands-On – The Core Language by Tom Owsiak

Author:Tom Owsiak [Tom Owsiak]
Language: eng
Format: epub
Tags: COM051310 - COMPUTERS / Programming Languages / C#, COM051380 - COMPUTERS / Programming / Microsoft, COM051000 - COMPUTERS / Programming / General
Publisher: Packt
Published: 2017-10-13T12:20:33+00:00


What else can you do?

We can find the format of one of the things there. For this, we can enter the following:

sampLabel.Text += $"<br>The value at index (0,1) formatted as currency is {arr[0, 1]:C}";

Here, we start with sampLabel.Text and then use += to append. Then, we put in a <br> tag to move down to the next line, a $ symbol for string interpolation, double quotes to make a string data type, and say, for example, The value at index (0,1) formatted as currency is. As we are looking at index (0,1), we type {arr[0, 1]:C}.

Now, let's add comment 12 above this line as follows:

//12. Line below prints entry at index 0,1 formatted as currency

Let's take a look at this in Google Chrome, and click on Show Calculations. As you can see in the following screenshot, $34.00 is formatted as currency:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.