tags:

views:

173

answers:

2

How can I convert a binary string, such as 1001101 to Decimal? (77)

+15  A: 

The Convert.ToInt32 method has an overload that accepts a base parameter.

Convert.ToInt32("1001101", 2).ToString();
SLaks
+3  A: 

Take a look at this questions which is very similar but dealing with hex http://stackoverflow.com/questions/74148/how-to-convert-numbers-between-hex-and-decimal-in-c

Convert.ToInt64(value, 2)
John Duff