Here's a quick sketch of one way you might approach this:
private const int chunkSize = 5;
private string source = "a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#";
private string sourceCopy;
private List<string> sourceList;
private List<TextBox> textBoxes;
private void Form1_Load(object sender, EventArgs e)
{
sourceCopy = source;
textBox1.Text = sourceCopy;
textBoxes = new List<TextBox>{textBox2, textBox3, textBox4, textBox5, textBox6};
sourceList = source.Split(new char[] {'#'}, StringSplitOptions.RemoveEmptyEntries).ToList();
}
private void button1_Click(object sender, EventArgs e)
{
if (sourceList.Count == 0)
{
MessageBox.Show("running on empty: refuel ?");
foreach(TextBox tb in textBoxes) tb.Clear();
return;
}
int nToTake = (sourceList.Count < chunkSize) ? sourceList.Count : chunkSize;
for (int i = 0; i < chunkSize; i++)
{
textBoxes[i].Text = (i < nToTake) ? sourceList[i] : "";
}
sourceList.RemoveRange(0, nToTake);
sourceCopy = sourceCopy.Remove(0, nToTake*2);
textBox1.Text = sourceCopy;
}
Converting the string[] produced by using 'Split to a List<string> allows using the handy 'RemoveRange(index, count) operator on the List. Putting the five TextBoxes used for single character display in a List makes iterating over all of them easy, and avoids repetitive coding.
Note that a copy of the source string was used based on the idea you might wish to use the original again.