We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ff1732 commit ed3bcc3Copy full SHA for ed3bcc3
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs
@@ -889,11 +889,11 @@ public override void Write(string? value)
889
890
if (value.EndsWith("\r\n", StringComparison.Ordinal))
891
{
892
- WriteLine(value.Substring(0, value.Length - 2));
+ WriteLine(value[..^2]);
893
}
894
else if (value.EndsWith("\n", StringComparison.Ordinal))
895
896
- WriteLine(value.Substring(0, value.Length - 1));
+ WriteLine(value[..^1]);
897
898
else
899
0 commit comments