To change the mentioned method to a one-liner in C#, you can use the expression-bodied syntax. Here's the modified code:
main.cs42 chars2 lines
By using the =>
arrow syntax, you can directly return the value 40
without the need for the return
keyword.
gistlibby LogSnag