Support .NET Framework 3.5

This commit is contained in:
Matt Nadareski
2023-11-20 22:00:32 -05:00
parent 6c482ab98b
commit 7da7967762
12 changed files with 96 additions and 84 deletions

View File

@@ -266,7 +266,7 @@ namespace SabreTools.IO
byte[] nullTerminator = encoding.GetBytes(new char[] { '\0' });
int charWidth = nullTerminator.Length;
List<char> keyChars = new List<char>();
var keyChars = new List<char>();
while (offset < content.Length)
{
char c = encoding.GetChars(content, offset, charWidth)[0];
@@ -277,7 +277,7 @@ namespace SabreTools.IO
break;
}
return new string(keyChars.ToArray()).TrimEnd('\0');
return new string([.. keyChars]).TrimEnd('\0');
}
}
}