Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Go

Idiom #339 Clear a byte array

Set all the elements of the byte array a to zero

clear(a[:])

a is an array (but slices are more common)
clear(a)

a is a slice
Array.Fill(a, (byte)0);

New implementation...
< >
programming-idioms.org