private static char[,] ToTable(string value, int colCount) {
throw new ArgumentNullException(nameof(value));
throw new ArgumentOutOfRangeException(nameof(colCount));
char[,] result = new char[
value.Length / colCount + (value.Length % colCount == 0 ? 0 : 1),
for (int r = 0; r < result.GetLength(0); ++r)
for (int c = 0; c < result.GetLength(1); ++c)
for (int i = 0; i < value.Length; ++i)
result[i / result.GetLength(1), i % result.GetLength(1)] = value[i];
public static void Main() {
string test = "DELICIOUS FOOD";
var result = ToTable(test, 5);
for (int r = 0; r < result.GetLength(0); ++r) {
for (int c = 0; c < result.GetLength(1); ++c) {
Console.Write(result[r, c]);