char方式转换string为int
char[] a = new char[5] { '1', '2', '3', '4', '5' };//"12345 ";
int[] b = new int[6];
for (int i = 0; i < 5; i++)
{
b[i] = a[i] - 48;
}
int c = 10000 * b[0] + 1000 * b[1] + 100 * b[2] + 10 * b[3] + b[4];
Console.WriteLine(c);
Console.ReadKey();
int[] b = new int[6];
for (int i = 0; i < 5; i++)
{
b[i] = a[i] - 48;
}
int c = 10000 * b[0] + 1000 * b[1] + 100 * b[2] + 10 * b[3] + b[4];
Console.WriteLine(c);
Console.ReadKey();