Just change your code to:
string yourByteString = Convert.ToString(byteArray[20], 2).PadLeft(8, '0');
// produces "00111111"
More Related Contents:
- Converting string to byte array in C#
- How to know the size of the string in bytes?
- String to Binary in C#
- Write bytes to file
- Convert binary string into integer
- Byte to Binary String C# – Display all 8 digits
- Iterating through a List and .Contains isn’t catching string [closed]
- .NET String.Format() to add commas in thousands place for a number
- Identify if a string is a number
- Are string.Equals() and == operator really same? [duplicate]
- How can I strip HTML tags from a string in ASP.NET?
- Convert a list to a string in C#
- Find text in string with C#
- Multiple string comparison with C#
- String concatenation vs String Builder. Performance
- Save and retrieve image (binary) from SQL Server using Entity Framework 6
- Characters in string changed after downloading HTML from the internet
- Getting hash of a list of strings regardless of order
- How to read file binary in C#?
- Easier way of writing null or empty?
- How can I get a character in a string by index?
- What is the difference between .Equals and == [duplicate]
- Convert from BitArray to Byte
- C# Append byte array to existing file
- How do i split a String into multiple values?
- How can I Unescape and Reescape strings in .net?
- What does the @ prefix do on string literals in C#
- Int to string: cannot convert from ‘method group’ to ‘string’ [closed]
- Does any one know of a faster method to do String.Split()?
- How do i replace accents (german) in .NET