CSharp · Console
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
string[] names = new string[6];
names[0] = "Person 1";
names[1] = "Person 2";
names[2] = "Person 3";
names[3] = "Person 4";
names[4] = "Person 5";
names[5] = "Person 6";
var result = Enumerable.Range(0, names.Length / 3)
.Select(i => new string[] { names[i], names[i+1], names[i+2] })
.ToArray();
StringBuilder sb = new StringBuilder();
sb.AppendLine("[My Windows Form. . . . . . . . . . . . . . . . [X]]");
sb.AppendLine("|GROUP A | GROUP B | GROUP C|");
foreach (var item in result)
{
sb.AppendLine("|{" +item[0] + "}|{" + item[1] + "}|{" + item[2] + "}");
}
Console.WriteLine(sb.ToString());
}
}