Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
comparer implementation
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Linq; using System.Text.RegularExpressions; using System.Collections; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); string m = "Monday"; string[] daysOfWeek = {m,"yas",m,m}; var comparer = new StringLengthComparator(); Array.Sort(daysOfWeek, comparer); for (int i = 0;i < 4; i++){ Console.WriteLine(daysOfWeek[i]); } } } public class StringLengthComparator : System.Collections.Generic.IComparer<string>{ public int Compare(string x, string y){ return x.Length.CompareTo(y.Length); } } }
run
|
edit
|
history
|
help
0
Sum Matrix Column
test
Case where use of default constructor ( this() ) is mandatory
The Collatz Conjecture
Creating async methods in C# prior to version 5.0
Https://www.t.me/Govnoposti
saira_pr1.c
WithoutPortNo
file Info and File Stream
Fibonacci of array elements C#