C# Сравниваю две одинаковые строки и выдает false
Отправляю с сервера который работает на UdpClient sqlite3 файл, на клиенте нужно проверить является ли файл sqlite3 формата.Первые 16 байтов этого формата в консоли выглядят вот так : "SQLite format 3". Почему 16 байтов если char символов 15? И при сравнении с такой же строкой выдает false. Сравнивал и через String.Equals и через "==".
public static bool isResponseSQLiteFormat(byte[] bytes)
{
///
/// Takes first 16 bytes of array and convert it into string. This bytes contains file format
/// if it's sqlite3.
///
byte[] bytesWithFileFormat = new byte[16];
for(int index = 0; index < 16; index++)
{
bytesWithFileFormat[index] = bytes[index];
}
/// Does not return true if string equals value here |
/// v
return Encoding.ASCII.GetString(bytesWithFileFormat).Equals("SQLite format 3 ");
}