Vorrei convertire un numero binario scritto in una stringa nel suo valore intero.
Per esempio:
string input = "0101"; int output = convert(input);
output
dovrebbe essere uguale a 5
Convert.ToInt32 (String, Int32) consente di specificare la base:
int output = Convert.ToInt32(input, 2);