Introduction
I thought that the tip was really more interesting, but please do not use such title and then depress myself with that.
An elegant solution is:
List<int> myList = new List<int>() {1,2,1};
Console.WriteLine("All numbers are{0} the same",
myList.Any((i) => i != myList[0])? " not":String.Empty);
Console.ReadKey();
Just a line, not any loops, and multiple unnecessary stuff.
I'm Electronic Engineer, I did my end degree project at Astrophysical Institute and Tech Institute. I'm HP Procurve AIS and ASE ,Microsoft 3.5 MCTS
I live in Canary Islands ,developing customized solutions
Deeply involved in Xamarin Forms LOB (including Azure Cloud with offline support, custom controls, dependencies) projects, WP8.1 & W10 projects, WPF modern styled projects. Portable libraries like portablePDF, portableOneDrive, portableReports and portablePrinting (using Google Printing API).
Web and apps showcase at:
Expediteapps
Take a look to my blog
Blog