Delegates are a way to declare accepted properties and returntype of methods, without having to write the actual code for the method. This can be handy when the method of an object depends upon the actual object itself. When writing methods you define returntype, parameters and the actual code to be performed, the function body. …
Category Archives: C# basics
C# basics: $pecial Ch@racters
String interpolation – $ Definition of interpolate: transitive verb 1a: to alter or corrupt (something, such as a text) by inserting new or foreign matter b: to insert (words) into a text or into a conversation Source: Merriam-webster When you want to insert code expressions in a string, using a string interpolation with the $ character in front …
C# basics: foreach loops
foreach loops are used to loop through collections of objects. C# has many standard type of loop functions, but the foreach loop is a special case. It can however be broken down to basic components to understand how it works. Imagine you have an array of cars that you iterate with a foreach loop: //The …
