Convert string in bianry value format to int in CSharp

Description

The following code shows how to convert string in bianry value format to int.

Example


using System;// w  w  w. java2 s. co m
public class MainClass {
    public static void Main() {

        uint five = Convert.ToUInt32("101", 2);      // parse in binary
        Console.WriteLine(five);

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var