public static void Main()
public static bool notEqualString(string a, string b)
return (!(equalString(a,b)) && !(greaterString(a,b)));
public static bool lowerEqualString(string a, string b)
return (equalString(a,b) || !greaterString(a,b));
public static bool lowerString(string a, string b)
return (!equalString( a, b) && !greaterString( a, b) );
public static void testGreaterString()
Console.WriteLine("- Test di Greater -");
b = greaterString(s1, s2);
Console.WriteLine(" test 7 -> " + (b==false).ToString());
b = greaterString(s1, s2);
Console.WriteLine(" test 5 -> " + (b==true).ToString());
b = greaterString(s1, s2);
Console.WriteLine(" test 6 -> " + (b==true).ToString());
b = greaterString(s1, s2);
Console.WriteLine(" test 3 -> " + (b==true).ToString());
b = greaterString(s1, s2);
Console.WriteLine(" test 4 -> " + (b==true).ToString());
s1 = "aaaa"; s2= "aaaab";
b = greaterString(s1, s2);
Console.WriteLine(" test 1 -> " + (b==false).ToString());
b = greaterString(s1, s2);
Console.WriteLine(" test 2 -> " + (b==false).ToString());
public static bool greaterString(string a, string b)
public static void testEqualString()
Console.WriteLine("- Test di Equal -");
Console.WriteLine(" test 1 -> " + (b==true).ToString());
Console.WriteLine(" test 2 -> " + (b==false).ToString());
Console.WriteLine(" test 3 -> " + (b==false).ToString());
Console.WriteLine(" test 4 -> " + (b==true).ToString());
Console.WriteLine(" test 5 -> " + (b==false).ToString());
Console.WriteLine(" test 6 -> " + (b==false).ToString());
s1 = "abcccc"; s2= "abc";
Console.WriteLine(" test 7 -> " + (b==false).ToString());
Console.WriteLine(" test 8 -> " + (b==false).ToString());
public static bool equalString(string a, string b)
if ((a.Length <= i) && (b.Length <= i))
else if ((a.Length <= i) || (b.Length <= i))