Convert an ascii string number to a decimal number ?
Hi all,
From a UART connection I´m getting the following string "/XCC0001011111111111" and i need to discard the "/XCC00" part and convert the ascii code "01011111111111" to a dicimal or hex number.
But i don´t know how to do this - so please help me :-)
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Aug 29, 2009, 8:22 PM EDT
dont forget to mark "Do you like answer" please it will give me some credits :)
private void button1_Click(object sender, EventArgs e)
{
//Replace /xcc00 with Blank
string x = textBox2.Text.Trim().Replace("/XCC00",string.Empty);
//Convert Remaining Part to Hex
string Hex = Convert.ToString(Convert.ToInt32(x, 2), 16);
//Show in Message Box
MessageBox.Show(Hex);
}