From 7f0347c6644596748d24cc56a29cb32446e53fa6 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Mon, 4 Aug 2025 15:03:23 -0700 Subject: [PATCH] respond to feedback --- snippets/csharp/System/String/IndexOfAny/IndexOfAny1.cs | 9 ++++++--- snippets/csharp/System/String/IndexOfAny/ixany2.cs | 6 ++++-- snippets/csharp/System/String/IndexOfAny/ixany3.cs | 6 ++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/snippets/csharp/System/String/IndexOfAny/IndexOfAny1.cs b/snippets/csharp/System/String/IndexOfAny/IndexOfAny1.cs index bd5da47b4d8..7e46888284c 100644 --- a/snippets/csharp/System/String/IndexOfAny/IndexOfAny1.cs +++ b/snippets/csharp/System/String/IndexOfAny/IndexOfAny1.cs @@ -8,12 +8,15 @@ public static void Run() char[] chars = { 'a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y' }; String s = "The long and winding road..."; - Console.WriteLine($"The first vowel in \n {s}\n" + - $"is found at index {s.IndexOfAny(chars)}"); + Console.WriteLine($""" + The first vowel in + '{s}' + is found at index {s.IndexOfAny(chars)} + """); // The example displays the following output: // The first vowel in - // The long and winding road... + // 'The long and winding road...' // is found at index 2 // } diff --git a/snippets/csharp/System/String/IndexOfAny/ixany2.cs b/snippets/csharp/System/String/IndexOfAny/ixany2.cs index 4bd096b2703..f609c99f66d 100644 --- a/snippets/csharp/System/String/IndexOfAny/ixany2.cs +++ b/snippets/csharp/System/String/IndexOfAny/ixany2.cs @@ -22,8 +22,10 @@ public static void Run() Console.WriteLine(); Console.WriteLine("The first character occurrence " + $"from position {start} to {str.Length - 1}:"); - Console.WriteLine($"{Environment.NewLine}{br1}{Environment.NewLine}" + - $"{br2}{Environment.NewLine}{str}{Environment.NewLine}"); + Console.WriteLine($""" + {Environment.NewLine}{br1}{Environment.NewLine} + {br2}{Environment.NewLine}{str}{Environment.NewLine} + """); Console.Write($"A character in '{target}' occurs at position: "); at = str.IndexOfAny(anyOf, start); diff --git a/snippets/csharp/System/String/IndexOfAny/ixany3.cs b/snippets/csharp/System/String/IndexOfAny/ixany3.cs index cd33a33b681..2ad0da779a2 100644 --- a/snippets/csharp/System/String/IndexOfAny/ixany3.cs +++ b/snippets/csharp/System/String/IndexOfAny/ixany3.cs @@ -21,8 +21,10 @@ public static void Run() Console.WriteLine(); Console.WriteLine("The first character occurrence from " + $"position {start} for {count} characters:"); - Console.WriteLine($"{Environment.NewLine}{br1}{Environment.NewLine}{br2}" + - $"{Environment.NewLine}{str}{Environment.NewLine}"); + Console.WriteLine($""" + {Environment.NewLine}{br1}{Environment.NewLine}{br2} + {Environment.NewLine}{str}{Environment.NewLine} + """); Console.Write($"A character in '{target}' occurs at position: "); int at = str.IndexOfAny(anyOf, start, count);