fork(4) download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. List<string> bunchOfStrings = new List<string>();
  10. bunchOfStrings.Add("This should not be at the top");
  11. bunchOfStrings.Add("This should not be at the top either");
  12. bunchOfStrings.Add("This should also not be at the top");
  13. bunchOfStrings.Add("This *SHOULD be at the top");
  14. bunchOfStrings.Add("This should not be at the top");
  15. bunchOfStrings.Add("This should be *somewhere close to the top");
  16.  
  17. foreach (var s in bunchOfStrings.OrderByDescending(x => x.Contains("*"))) {
  18. Console.WriteLine(s);
  19. }
  20. }
  21. }
Success #stdin #stdout 0.06s 35024KB
stdin
Standard input is empty
stdout
This *SHOULD be at the top
This should be *somewhere close to the top
This should not be at the top
This should not be at the top either
This should also not be at the top
This should not be at the top