development:csharp:byte_to_bin_and_vice_versa

C# Converting byte to binary string and vice versa

string a = Convert.ToString(value, 2).PadLeft(8, '0');   // Convert byte (value) to binary string
byte a = Convert.ToByte(NewFlags, 2);                    // Convert binary string to byte
Enter your comment:
X W B S E
 
  • development/csharp/byte_to_bin_and_vice_versa.txt
  • Last modified: 2021-05-19 12:17
  • by tplecko