you can remove empty array. Your code should look like
byte[] MainArray = new byte[4096];
byte[] String = Encoding.ASCII.GetBytes("hello world");
Array.Copy(String, 0, MainArray, 0, String.Length);
MainArray = MainArray.Where(v => v > 0).ToArray();
the statement
MainArray = MainArray.Where(v => v > 0).ToArray();
will redefine your array with actual data.