Possible Duplicate:
Converting long string of binary to hex c#
nyI'm looking for a way to convert a string of binary to a hex string.
the binary string has four positions. the binary string looks something like this
string binarystring= "1011";
output string should be like this
output string="B";
is there any way to convert a string of binary into hex?
Convert.ToInt32("1011", 2).ToString("X");
For more information about the string value used with ToString()
as its parameter, check the following documentation:
https://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With