Q:

C# - Filling an array using a Strings chars doesn't work properly

I've got an
int[,] map = int[100, 100];

and a
String mapString;

mapString simply contains a large amount of numbers (there are no other chars than numbers).
I now want to assign the first value in the array(map[0,0]) with the first char of mapString, the second value(map[0,1]) with the second char of mapString and so on. I use the following code:
int currentposition = 0;
for (int x = 0; x < 100; x++)
{
    for (int y = 0; y < 100; y++)
    {
        map[x, y] = ArrayTest.Properties
                             .Settings
                             .Default
                             .mapSaveSetting
                             .ElementAt(currentposition);
        currentposition++;
    }
}

Now what happens is almost what I wished for.
The problem is that it assigns two numbers to each value instead of one. Also i can't figure out what numbers he's using as they're not the ones in my mapSaveSetting, but I can deal with that for myself.
The only problem I really don't get is that each value contains two numbers after executing this for-loop. Why does it happen? ElementAt(int) only returns one char, right?
It really looks like a logical mistake to me but I can't find it. Please don't be offensive if I just made a dumb mistake in my way of thinking.
EDIT
As it seems to be unclear what is the problem now, I'll add an example.
map[0, 0] == 42

...could be an output. Even if the String would start with e.g. 4245634 it would not make sense, as ElementAt(int) should only return the 4, not 42, right?

A:

You are assigning char to int.Since there is implicit conversation from char to int you are getting the Unicode code of the character (in your case characters representing numbers).To fix you issue you should convert character to int.
In your case as the all characters are numeric you can do as trick like this:
map[x, y] = 
   ArrayTest.Properties.Settings.Default.mapSaveSetting.ElementAt(currentposition) - 48;

This work because Unicode codes of symbols [0..9] sequential and equals to [48..57].

