How to do it...

  1. Add the following lines of code to your project. It is clear that the newNum literal is easier to read, especially if you read it in groups of three.
        var oldNum = 342057239127493;        var newNum = 342_057_239_127_493;        WriteLine($"oldNum = {oldNum} and newNum = {newNum}");
  1. If you run the console application, you will see that the values of the two number literals are exactly the same:
  1. The same logic is true for binary literals. You can now express them as follows:
        var binLit = 0b1010_1100_0011_0010_0001_0000;

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.