Skip to Content
C# and .NET Core Test-Driven Development
book

C# and .NET Core Test-Driven Development

by Ayobami Adewole
May 2018
Intermediate to advanced content levelIntermediate to advanced
300 pages
7h 35m
English
Packt Publishing
Content preview from C# and .NET Core Test-Driven Development

Digit separator and binary literal

A new syntatic sugar has been added to C# 7, which is the digit separator. This construct greatly improves code readability, especially when handling large numbers of different numeric types supported in C#. Prior to C# 7, manipulating large numeric values to have separators was a bit messy and unreadable. With the introduction of the digit separator, you can now use an underscore (_) as a separator for digits:

var longDigit = 2_300_400_500_78;

Also newly introduced in this version is binary literals. You can now create binary literals by simply including 0b as a prefix to binary values:

var binaryValue = 0b11101011;
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Design Patterns with C# and .NET Core

Hands-On Design Patterns with C# and .NET Core

Gaurav Aroraa, Jeffrey Chilberto
.NET Core in Action

.NET Core in Action

Dustin Metzgar

Publisher Resources

ISBN: 9781788292481Supplemental Content