I have string
w0 = "2B7E1516"
I want to convert it to a binary string in order to be
"00101011011111100001010100010110"
However i keep getting only "101011011111100001010100010110":
w0 = "2B7E1516";
char paddingChar = '0';
w0 = Convert.ToString(Convert.ToInt32(w0, 16), 2).PadLeft(8, paddingChar);
The problem is in 2 it converts it to only "10" not to "0010", how can i fix that?