ASCII To Decimal
This algorithm converts ASCII code to decimal numbers.
public static string ASCIIToDecimal(string str)
{
string dec = string.Empty;
for (int i = 0; i < str.Length; ++i)
{
string cDec = ((byte)str[i]).ToString();
if (cDec.Length < 3)
cDec = cDec.PadLeft(3, '0');
dec += cDec;
}
return dec;
}
Example
string data = "Programming Algorithms";
string value = ASCIIToDecimal(data);
Output
080114111103114097109109105110103032065108103111114105116104109115