Hi all , I'm a beginner in C# , I'm trying to do this ..... user input "43 24" and the application take this input , put 43 in arr1[0] , and 24 in arr1[1] . The arr1 is char[] type .. i tried this : (This is only a part of the code of course) (wholeLine is type string)
foreach (char ch in wholeLine)
{
if (ch != ' ')
{
arr1[0] += ch ;
}
}
and the output for arr[0] is : g
I tried to make arr1 an int[] type and did this :
foreach (char ch in wholeLine)
{
if (ch != ' ')
{
int z = Convert.ToInt32(ch.ToString());
arr1[0] += z ;
}
}
But the output is : 7
I just want arr[0] to contain 43
, i think it's a conversions issue , but i have no clue what to do , so help please :)
Thanks in advance .