Category: C#

How to Use the Conditional Operator (?) in C# ?

Conditional Operator is also called as ternary operator which lets the developers to select between 2 values with a statement. Assume that you have to check for a number if it is even , we generally tend to use the if else statement . The same can be achieved using the ternary operator in C#. How to Use the Conditional Operator (?) in C# ?…

How to Get the Top 5 elements from a List in C# ?

If you want to get the top 5 elements from a list in C# or skip the first item and get the next five elements from a List , you can use the Take and the Skip methods. How to Get the Top 5 elements from a List in C# ? Below is a sample code snippet demonstrating the usage of the Skip and Take…

Upgrading Windows Phone 7.5 App to Windows Phone 8 in Visual Studio 2012.

If you want to utilize the capabilities or the features of Windows Phone 8 in your Windows Phone 7.5 project, you might need to upgrade it to Windows Phone 8. Once you upgrade your Windows Phone 7.5 project to Windows Phone 8, you cannot revert back and hence it always better to copy/backup your Windows Phone 7.5 project before upgrading. Upgrading Windows Phone 7.5 App…

How to Sort Array Elements in Descending Order in C#?

The Array class includes static method called Sort which can be used to sort the array in ascending order. After using the Sort method, one can use the Reverse method to sort the array back to descending order. How to Sort Array Elements in Descending Order in C#? Below is a sample code snippet demonstrating sorting of array elements in Descending order in C#.