C# string interpolation is a method of concatenating,formatting and manipulating strings. This feature was introduced in C# 6.0. Using string interpolation, we can use objects and expressions as a part of the string interpolation operation.
If x and y are non-integer values x % y is computed as x – n * y, where n is the largest possible integer that is less than or equal to x / y (more details in the C# 4.0 Specification in section 7.8.3 Remainder operator). For further details and examples you might want to have a look at the corresponding Wikipedia article:
C# is not assembler, and out of 99.9% of the times i++ or ++i are used in code, the things going on in the background are just that; in the background. I write C# to climb to abstraction levels above what's going on on this level, so if this really matters for your C# code, you might already be in the wrong language.
See this post Difference between Property and Field in C# 3.0+ on the difference between a field and a property getter in C#. Update: Note that expression-bodied members were expanded to include properties, constructors, finalizers and indexers in C# 7.0.
The sample below is a little long because I am showing you both the custom version and the flags enum. If you remove the flags enum and the associated functions in the struc, you can see the minimum code needed to support a custom version. For me, this simple logic replaced many hundreds of lines of C# code to determine the status of an order.
C# supports two boolean or operators: the single bar | and the double-bar ||. The difference is that | always checks both the left and right conditions, while || only checks the right-side condition if it's necessary (if the left side evaluates to false).
I understand that the @ symbol can be used before a string literal to change how the compiler parses the string. But what does it mean when a variable name is prefixed with the @ symbol?