How to convert binary to decimal

后端 未结 6 1990
忘掉有多难
忘掉有多难 2020-12-05 07:21

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

6条回答
  •  失恋的感觉
    2020-12-05 07:56

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

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

提交回复
热议问题