diff --git a/src/GraphQLParser/Exceptions/GraphQLParserException.cs b/src/GraphQLParser/Exceptions/GraphQLParserException.cs index fdf443a..2e52310 100644 --- a/src/GraphQLParser/Exceptions/GraphQLParserException.cs +++ b/src/GraphQLParser/Exceptions/GraphQLParserException.cs @@ -8,7 +8,9 @@ namespace GraphQLParser.Exceptions; /// public class GraphQLParserException : Exception { - private static readonly char[] NewlineSeparator = ['\n']; +#if NETSTANDARD2_0 + private static readonly char[] _newlineSeparator = ['\n']; +#endif /// /// Error description. @@ -51,7 +53,11 @@ private static string HighlightSourceAtLocation(ReadOnlySpan source, Locat int padLen = nextLineNum.Length; string[] lines = source .ToString() - .Split(NewlineSeparator, StringSplitOptions.None) +#if NETSTANDARD2_0 + .Split(_newlineSeparator, StringSplitOptions.None) +#else + .Split('\n', StringSplitOptions.None) +#endif .Select(e => ReplaceWithUnicodeRepresentation(e)) .ToArray();