28
文字列に書き込まれた2進数をその整数値に変換したいと思います。例えばバイナリ文字列を整数に変換する
:
string input = "0101";
int output = convert(input);
output
は、あなたがベースを指定することができます
文字列に書き込まれた2進数をその整数値に変換したいと思います。例えばバイナリ文字列を整数に変換する
:
string input = "0101";
int output = convert(input);
output
は、あなたがベースを指定することができます
Convert.ToInt32(String, Int32)5
と同じでなければなりません:
int output = Convert.ToInt32(input, 2);
あなたはグーグルで試してみてください尋ねる前に、 "C#がYにXを変換します" 。 – ken2k
[Binary String to Integer]の複製が可能です(http://stackoverflow.com/questions/1271562/binary-string-to-integer) –
@TimLloydもう1つ質問がありますか?何かがこの質問の欺瞞であるなら: – mhvelplund