You could replace \0 first
string[] lines = {
"......................EMS-SoftwareVersion-\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0...........................",
"......................EMS-SoftwareVersion-\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0..........................."
};
var results = string.Join(",", lines.Select(x => x.Replace("\0", "")).ToArray());
Console.WriteLine(results);