So I've been woking a Console game for a while now and I desided to use .txt files to hold the maps. This code opens and stores the txt file contents:

```
        static void LoadMap(string fname)
    {
        string _org = File.ReadAllText("Maps/" + fname + ".txt");
        _org.Split(',');
        string[] _tmp = new string[_org.Length];
        for (int i=0;i<_org.Length;i++)
        {
            _tmp[i] = _org[i].ToString();
        }
        //This line has the error
        for (int i=0;_tmp[i]!="$";i+=2)
        {
            mapwidth += 1;
        }
        for (int i=0;i<_tmp.Length;i++)
        {
            leveldata.Add(_tmp[i]);
        }
    }

```

I get this error: Index was outside the bounds of the array. I can't figgure out why. Can anyone help? Thanks