Skip to content

Commit

Permalink
Updated DiamondTests.cs
Browse files Browse the repository at this point in the history
`Rows` method adjusted to use system dependent new line characters.
  • Loading branch information
spirit11 authored Dec 5, 2024
1 parent b337aa8 commit 4e768bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exercises/practice/diamond/DiamondTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class DiamondTests
{
public static readonly char[] AllLetters = GetLetterRange('A', 'Z');
private static string[] Rows(string x) => x.Split(new[] { '\n' }, StringSplitOptions.None);
private static string[] Rows(string x) => x.Split(Environment.NewLine);

private static string LeadingSpaces(string x) => x.Substring(0, x.IndexOfAny(AllLetters));
private static string TrailingSpaces(string x) => x.Substring(x.LastIndexOfAny(AllLetters) + 1);
Expand Down Expand Up @@ -125,4 +125,4 @@ public static Arbitrary<char> Chars()
{
return Arb.Default.Char().Filter(x => x >= 'A' && x <= 'Z');
}
}
}

0 comments on commit 4e768bc

Please sign in to comment.