fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int cmpValue = String.Compare("N-1.2.0.10", "N-1.2.0.8", StringComparison.InvariantCultureIgnoreCase);
  8. if(cmpValue > 0)
  9. Console.WriteLine("greater");
  10.  
  11. cmpValue = String.Compare("N-1.2.0.10", "N-1.2.1.10", StringComparison.InvariantCultureIgnoreCase);
  12. if(cmpValue < 0)
  13. Console.WriteLine("lesser");
  14.  
  15. cmpValue = String.Compare("N-1.2.0.10", "N-1.2.0.10", StringComparison.InvariantCultureIgnoreCase);
  16. if(cmpValue == 0)
  17. Console.WriteLine("equal");
  18.  
  19. }
  20. }
Success #stdin #stdout 0.04s 33944KB
stdin
Standard input is empty
stdout
lesser
equal