Skip to content

Commit 7f0347c

Browse files
committed
respond to feedback
1 parent 63ef04d commit 7f0347c

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

snippets/csharp/System/String/IndexOfAny/IndexOfAny1.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ public static void Run()
88
char[] chars = { 'a', 'e', 'i', 'o', 'u', 'y',
99
'A', 'E', 'I', 'O', 'U', 'Y' };
1010
String s = "The long and winding road...";
11-
Console.WriteLine($"The first vowel in \n {s}\n" +
12-
$"is found at index {s.IndexOfAny(chars)}");
11+
Console.WriteLine($"""
12+
The first vowel in
13+
'{s}'
14+
is found at index {s.IndexOfAny(chars)}
15+
""");
1316

1417
// The example displays the following output:
1518
// The first vowel in
16-
// The long and winding road...
19+
// 'The long and winding road...'
1720
// is found at index 2
1821
// </Snippet1>
1922
}

snippets/csharp/System/String/IndexOfAny/ixany2.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ public static void Run()
2222
Console.WriteLine();
2323
Console.WriteLine("The first character occurrence " +
2424
$"from position {start} to {str.Length - 1}:");
25-
Console.WriteLine($"{Environment.NewLine}{br1}{Environment.NewLine}" +
26-
$"{br2}{Environment.NewLine}{str}{Environment.NewLine}");
25+
Console.WriteLine($"""
26+
{Environment.NewLine}{br1}{Environment.NewLine}
27+
{br2}{Environment.NewLine}{str}{Environment.NewLine}
28+
""");
2729
Console.Write($"A character in '{target}' occurs at position: ");
2830

2931
at = str.IndexOfAny(anyOf, start);

snippets/csharp/System/String/IndexOfAny/ixany3.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ public static void Run()
2121
Console.WriteLine();
2222
Console.WriteLine("The first character occurrence from " +
2323
$"position {start} for {count} characters:");
24-
Console.WriteLine($"{Environment.NewLine}{br1}{Environment.NewLine}{br2}" +
25-
$"{Environment.NewLine}{str}{Environment.NewLine}");
24+
Console.WriteLine($"""
25+
{Environment.NewLine}{br1}{Environment.NewLine}{br2}
26+
{Environment.NewLine}{str}{Environment.NewLine}
27+
""");
2628
Console.Write($"A character in '{target}' occurs at position: ");
2729

2830
int at = str.IndexOfAny(anyOf, start, count);

0 commit comments

Comments
 (0)