diff --git a/snippets/csharp/VS_Snippets_CLR/string.compare4/CS/comp4.cs b/snippets/csharp/VS_Snippets_CLR/string.compare4/CS/comp4.cs index 6a22ace5ccb..fbd155163fa 100644 --- a/snippets/csharp/VS_Snippets_CLR/string.compare4/CS/comp4.cs +++ b/snippets/csharp/VS_Snippets_CLR/string.compare4/CS/comp4.cs @@ -1,4 +1,3 @@ -// // Sample for String.Compare(String, Int32, String, Int32, Int32, Boolean) using System; @@ -6,6 +5,7 @@ class Sample { public static void Main() { + // String str1 = "MACHINE"; String str2 = "machine"; String str; @@ -13,6 +13,7 @@ public static void Main() Console.WriteLine(); Console.WriteLine("str1 = '{0}', str2 = '{1}'", str1, str2); + Console.WriteLine("Ignore case:"); result = String.Compare(str1, 2, str2, 2, 2, true); str = ((result < 0) ? "less than" : ((result > 0) ? "greater than" : "equal to")); @@ -20,6 +21,7 @@ public static void Main() Console.Write("{0} ", str); Console.WriteLine("substring '{0}' in '{1}'.", str2.Substring(2, 2), str2); Console.WriteLine(); + Console.WriteLine("Honor case:"); result = String.Compare(str1, 2, str2, 2, 2, false); str = ((result < 0) ? "less than" : ((result > 0) ? "greater than" : "equal to")); @@ -37,6 +39,6 @@ public static void Main() Honor case: Substring 'CH' in 'MACHINE' is greater than substring 'ch' in 'machine'. */ + // } } -// diff --git a/snippets/csharp/VS_Snippets_CLR_System/system.string.isnullorempty/cs/isnullorempty1.cs b/snippets/csharp/VS_Snippets_CLR_System/system.string.isnullorempty/cs/isnullorempty1.cs index 7e63f095e42..1172a58eaa3 100644 --- a/snippets/csharp/VS_Snippets_CLR_System/system.string.isnullorempty/cs/isnullorempty1.cs +++ b/snippets/csharp/VS_Snippets_CLR_System/system.string.isnullorempty/cs/isnullorempty1.cs @@ -16,6 +16,10 @@ bool TestForNullOrEmpty(string s) string s2 = ""; Console.WriteLine(TestForNullOrEmpty(s1)); Console.WriteLine(TestForNullOrEmpty(s2)); + + // The example displays the following output: + // True + // True // } }