using System;
using System.Text;
public class CreateStringFromOneRow
{
public static void Main()
{
char[][] jaggedArray = new char[3][];
// Initialize the rows with different lengths
jaggedArray[0] = new char[] { 'C', '#' };
jaggedArray[1] = new char[] { 'p', 'r', 'o', 'g', 'r', 'a', 'm', 'm', 'i', 'n', 'g' };
jaggedArray[2] = new char[] { 'l', 'a', 'n', 'g', 'u', 'a', 'g', 'e' };
// StringBuilder to hold the string of a row
StringBuilder sb = new StringBuilder();
// Iterate over the row and append characters to the StringBuilder
foreach (char ch in jaggedArray[1]) { // row 1
sb.Append(ch);
}
// Convert StringBuilder to string
string result = sb.ToString();
Console.WriteLine("The string is: " + result);
}
}
/*
run:
The string is: programming
*/