Gold Gold - 11 months ago 63
C# Question

How to convert binary to decimal

How can I convert a binary string, such as

1001101
to Decimal? (77)

Answer Source

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

Convert.ToInt32("1001101", 2).ToString();