Compared to other versions of C#, C# 7.0 has some good features, I am going to explain some of them.
But in C# 7.0 had change, now we can add this declaration inside TryParse itself, by this we can reduce the code
In older versions of C# we can have a function inside a function by using lambda expression or using delegate or using anonymous method but that was very complicated to read. C# 7.0 has got one cool feature, that is we can create functions inside a function which are more readable, the below code is an example of creating functions inside a function in C# 7.0
As you can see here in the above example, inside the main function I have created one function called Add(), and inside this Add() function I have created difference() function, wow this is possible, this is a cool feature isn’t it?
In C# 7.0 we can separate numbers or literals by using underscore( “_” called as an under bar) , examples are shown below
As you can see in the above example the number 4878896050065380 was not readable, but in code declaration we can make this readable by separating parts using “-”. we can use any number of “-” , and the compiler will just ignore this when executing the program and it just gives the normal number as shown above.
in C# 7.0, Tuple is more simplified, In older versions of C# to use Tuple, we need to use keyword Tuple to declare Tuple and when retrieving time we will not know which one we are retrieving, that is we cannot give names to the variable inside Tuple, but in C# this is all possible, no need to use keyword Tuple to declare Tuple and we can give names to the variables
Example as shown below
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: