Empty elements in C# byte array

leon22 picture leon22 · Jul 1, 2011 · Viewed 90.3k times · Source

Is there any method to empty an Byte array in C#?

Byte[] array = new Byte[64]; // contain all 0

// write some value into the array

// need empty array with all 0's

Answer

Petar Ivanov picture Petar Ivanov · Jul 1, 2011
Byte[] array = new Byte[64];

Array.Clear(array, 0, array.Length);