Skip to content

Commit 47db7d3

Browse files
authored
DiamondTests.Rows method adjusted to be line-ending tolerant.
1 parent 4e768bc commit 47db7d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exercises/practice/diamond/DiamondTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
public class DiamondTests
88
{
99
public static readonly char[] AllLetters = GetLetterRange('A', 'Z');
10-
private static string[] Rows(string x) => x.Split(Environment.NewLine);
10+
private static string[] Rows(string x) => x.Split('\n').Select(line => line.TrimEnd('\r')).ToArray();
1111

1212
private static string LeadingSpaces(string x) => x.Substring(0, x.IndexOfAny(AllLetters));
1313
private static string TrailingSpaces(string x) => x.Substring(x.LastIndexOfAny(AllLetters) + 1);

0 commit comments

Comments
 (0)