string s = textBox4.Text; string[] ss = s.Split(new char[] { ' ' }); foreach (int i in ss) test_in[i] = Convert.ToInt32(ss[i]);